To connect Power BI to a real-time IoT data source, the most effective approach is to use Azure Stream Analytics (ASA) to process and route streaming data from Azure IoT Hub or Event Hub directly into Power BI streaming datasets. ASA allows you to filter, aggregate, and transform IoT data on the fly, then push the output to Power BI using the Power BI output connector, which creates a real-time dataset that automatically feeds a live dashboard.
Alternatively, for more control and persistence, you can route your IoT data to a SQL database or Azure Synapse Analytics, and connect Power BI using DirectQuery. This allows for near real-time visuals while supporting relational queries and historical analysis, though it's subject to query performance and refresh latency.
For lightweight real-time visuals (like sensor readings, counters, or status indicators), Push Datasets or Streaming Datasets in Power BI are ideal, especially when used with the REST API or tools like Power Automate. However, these are best suited for transient or less complex data. Combining Azure Stream Analytics with Power BI streaming datasets is the most scalable and low-latency solution for high-throughput IoT scenarios.