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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
CMccown
Helper I
Helper I

Need to filter a measure to reflect first date of value occurrence in a table

I have a table visualization reflecting raw data filtered by month and year with measures that determine the peak value, and the hour and date on which they occurred. Unfortunately during the month of February 2019, and December 2020 the peak value occurs twice in the same month and I want to reflect the data from Hour Ending 1 - Hour Ending 24 in the table from the correct peak date. I need assistance with either filtering my measure to account for this when finding the peak value, or by finding a way to break the tie for the TOPN filter I am using (see screen shot). 

 

My measure to calculate the peak load is: 

Monthly Peak Load = CALCULATE(MAX('System_Load'[Hr Sys Load]),FILTER('System_Load','System_Load'[Month]))
 
My measure to calculate peak hour is: 
Monthly Peak Hour = Var __SelectedMax =
 CALCULATE(
   CALCULATE(MAX('System_Load'[Hr Sys Load]),FILTER('System_Load','System_Load'[Month])))

RETURN
 
CALCULATE(MIN(System_Load[Hour Ending]),
    FILTER(System_Load, FIRSTDATE(System_Load[Date])),
        System_Load[Hr Sys Load] = __SelectedMax, System_Load[Month])
 
My measure to calculate peak date is:
 
Monthly Peak Date = Var __SelectedMax =

   CALCULATE(MAX('System_Load'[Hr Sys Load]),FILTER('System_Load','System_Load'[Month]))

RETURN

CALCULATE(
    FIRSTDATE(System_Load[Date]),
        System_Load[Hr Sys Load] = __SelectedMax, System_Load[Month])
 
As the screenshot shows, the peak value appears once on the correct peak hour Hour Ending 8, however, for the rest of the hours of the day, values for the correct peak date and the duplicate date (which happens to be the following day at the exact same hour in the example) are returned. 
 
CMccown_0-1678235304237.png

 Assistance is greatly appreciated!

 

 
0 REPLIES 0

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.