Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Ptown
Helper I
Helper I

Need help manipulating rows of half hourly sensor data from multiple sensors into one graph

I have a spreadsheet with approx. 150,000 rows of half hourly sensor data.

 

There is a Sensor Hardware ID column, a date column. Then 48 columns representing each 30 minute period in a day, which contain values for the sensor reading during that period.

 

Below example data table of dummy data that I hope explains the structure. I have only put data for 2 sensors for 2 days, rather than pasting 150,000 rows. I have only put data from 00:00 to 02:30 (6 data columns rather than all 48). 

 

The output that I would like to get can be seen in the sketch below. I would like a graph that has sensor reading on the Y axis and time of day on the X axis. The reading values of the graph would be the average (at each time of day) for the days selected by a filter. Each sensor would be a different coloured line on the legend.

 

Please could someone help me understand how I need to manipulate my raw data into a form that will get me my desired result? Sorry if I'm asking in the wrong place or my question isn't clear. Or if the answer is already out there somewhere, I've tried searching for a solution but have had a hard time knowing what to search for.

 

Example data table

Sensor Hardware IDDATE00:0000:3001:0001:3002:0002:30
ID-000101/01/2019336.9413.8820.8127.7534.69
ID-000102/01/2019224.639.2513.8818.5023.13
ID-000201/01/2019190.020.040.060.080.10
ID-000202/01/2019230.040.080.130.170.21

 

Graph:

https://www.imageupload.net/image/jZHDb

https://imgur.com/a/nLdl2GH

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks @Ashish_Mathur !

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

First, you need to unpivot the data https://radacad.com/pivot-and-unpivot-with-power-bi

You need to have date and time dimension to analyze your data better

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

Appreciate your Kudos. mark me with @

Thanks @amitchandak !

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.