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
fahadarshad
Helper I
Helper I

Calculating the maximum value of a measure over time

Hello everyone

 

I have a calculated measure for audience over time.

Audience = CALCULATE(SUM(Timings[Audience on Minute]),filter(ALLSELECTED(timings),Timings[Time Value]<=Max(Timings[Time Value])))
 
When I plot the visualisation I get the measure over time.
But I want to know at what time was the maximum value of the measure achieved and what value was it?
Appreciate your help
Untitled.png
1 ACCEPTED SOLUTION

@fahadarshad  You can use this approach, not sure if it fits your use case, I used some mock data.

 

1. Create a calculated table as follows:

AudienceSummary = SUMMARIZE(Timings, Timings[Time Value], "Audence Level", [Audience])
 
2. Create these two measures in this new table:
(a) Max Audience = MAX(AudienceSummary[Audence Level])
 
(b) Max Audience Time =
VAR maxaudience = [Max Audience]
RETURN CALCULATE(MAX(AudienceSummary[Time Value]), AudienceSummary[Audence Level]=maxaudience)
 
A picture of how it turned out on my desktop below.
PBI Help timings.PNG

View solution in original post

4 REPLIES 4
sanimesa
Post Prodigy
Post Prodigy

@fahadarshad  There is already an answered topic that seems to be what you are after:

https://community.powerbi.com/t5/Desktop/Obtain-the-maximum-value-of-a-Measure/m-p/856422

Thanks.

But there is also the requirement of wanting to know at what time the maximum value occured.

@fahadarshad  Were you able to try my solution or did you use some other method? I'd be curious to know.

My solution for both max value of the measure and the time the max value occurs is here:

https://community.powerbi.com/t5/Desktop/Calculating-the-maximum-value-of-a-measure-over-time/m-p/10...

@fahadarshad  You can use this approach, not sure if it fits your use case, I used some mock data.

 

1. Create a calculated table as follows:

AudienceSummary = SUMMARIZE(Timings, Timings[Time Value], "Audence Level", [Audience])
 
2. Create these two measures in this new table:
(a) Max Audience = MAX(AudienceSummary[Audence Level])
 
(b) Max Audience Time =
VAR maxaudience = [Max Audience]
RETURN CALCULATE(MAX(AudienceSummary[Time Value]), AudienceSummary[Audence Level]=maxaudience)
 
A picture of how it turned out on my desktop below.
PBI Help timings.PNG

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.