Power BI: Realtime Plant Simulation using SQL Server and Power BI Dashboard
DescriptionThis is a tutorial video on how to create a simulation for real-time data connectivity and visualization using Power BI and SQL Server. The video is presented by a trainer who takes the viewer through the process step-by-step.
The video starts by explaining the purpose of the simulation, which is to practice real-time data connectivity and visualization. The trainer then introduces the tools needed to create the simulation, which are Power BI and SQL Server.
The trainer then proceeds to show how to create a database in SQL Server and a table called "Monitor". The table has columns for Time, Voltage, Temperature, Pressure, Machine Load, and Output. The trainer explains how to set up the columns, their data types, and how to save the table.
Next, the trainer creates a SQL Query to simulate a plant dashboard. The query is used to generate random data every second, which will be displayed in Power BI Dashboard, in real-time. The trainer declares variables for each column, starting with the time column, using the same data types used during table creation. The trainer then creates a loop for the simulation, assigning values to each field in the table. The voltage field shows values between 1000 to 1100, the temperature field shows values between 110 to 120, the pressure field shows random values, the machine load shows random values, and the output field shows random values.
Finally, the trainer shows how to insert the values into the database after each iteration and how to execute the query to check the output. The trainer discovers that one field, pressure, was not included in the initial insert command and adds it to the query. The trainer executes the query again and shows how to use a select query to see if the data has been entered into the table.
Overall, this video is an excellent tutorial on how to create a simulation for real-time data connectivity and visualization using Power BI and SQL Server. The trainer explains each step clearly and concisely, making it easy to follow along.
declare @time datetime = getdate();
declare @v numeric(5,2) = 0;
declare @t numeric(5,2) = 0;
declare @p numeric(5,2) = 0;
declare @l numeric(5,2) = 0;
declare @o numeric(5,2) = 0;
waitfor delay '00:00:01'
set @time = getdate();
set @v = 900 + (rand()*100);
set @t = 110 + (rand()*10);
set @p = 80 + (rand()*30);
set @l = 80 + (rand()*30);
set @o = 80 + (rand()*30);
insert into monitor values (@time,@v,@t,@p,@l,@o);
00:31 - Creating SQL Database and Table
02:27 - Creating a Simulation using SQL Query
08:31 - Connecting Power BI to SQL Server
09:28 - Creating a Realtime Dashboard in Power BI Desktop
real-time data connectivity,
SQL Server Management Studio,
direct query method,