cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NightStalker
Regular Visitor

Displaying Max value of every 8 hours

I'm using custom Streaming Data. I use an ESP32 to push the real-time weight value of a sensor to Power BI API. However, I need a table displaying the weight max value of every 8 hours. My date column has date and time combined. 

Thanks in advance!

Capture.PNG

6 REPLIES 6
v-shex-msft
Community Support
Community Support

Hi @NightStalker,

I'd like to suggest you add an additional column into the push data step to extract and group hour values of your records. Then you can use this as a category in your chart to summarize your records with aggerate mode 'max'.
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Capture.PNG

 

Capture2.PNG

 

Hey thanks for the reply! I managed to push a fixed date and the shift from the ESP; However, the Earlier DAX don't work in real Time Data :S. It would've made everything easy. any suggestions.

Capture3.PNG

 

I managed to do it; however, I can't assign the date to it, as it shows all the values. I pushed DateShift which is a unique value for every day as it contains the 3 shifts during one day, and every shift is an 8-hour interval. Funny enough, I have no idea how I can calculate the sum of the ShiftPeak.

Hi @NightStalker,

>>Funny enough, I have no idea how I can calculate the sum of the ShiftPeak.

You can create a table visual with raw category fields and shiftpeak as category(click on them to choose 'do not summarize'), then you can add date field to this visual and choose aggerated mode 'max'/'last'.

In addition, can you please provide some dummy data to test? (keep raw table scheal and remove sensitive data fields)
Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Here you go. I can't share PBIX, as it's connected to real-time Data... CSV FILE 

Hi @NightStalker,

You can take a look at the following steps if helps:

1. Create a calculated field based on 'hourshift' to group these records.

Shift Group = 
VAR offset =
    INT ( HOUR ( [HourShift] ) / 8 )
RETURN
    offset
        + IF ( DATEDIFF ( TIME ( 8 * offset, 0, 0 ), [HourShift], SECOND ) > 0, 1, 0 )

2. Create a table visual with category fields and choose the summary mode of value fields to max.

12.png

Notice: other fields are setting to 'do not summarize'.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors