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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
nmckeown1
Helper II
Helper II

TopN Ranked times of calls

I'm trying to return a list of the top 4 time hours of calls answered.

I have a measure for the MAXX peak time, but want to include the top 3 and return the associated Time, as opposed to the actual value of sum of calls.

 

nmckeown1_0-1730888737602.png

 

The Peak time measure works fine as below: But only spits out the one max time. The table above is filtered for ranking 1-4, so I would like a measure for ranking 2, ranking 3 and ranking 4, so I  can include it in a statment. And say "The top peak times of calls was 2pm, 4pm, 1p, 11am and 3pm.

 

DAX Peak time Calls =
VAR Totalsalesperhour =
SUMMARIZE('Aggregated Daily','Aggregated Daily'[Time Hour], "TotalCalls",[Calls measure])
VAR MaxSales = MAXX(Totalsalesperhour,[TotalCalls])
RETURN
CALCULATE(
    MAX('Aggregated Daily'[Time Hour]),
    FILTER(Totalsalesperhour,[TotalCalls] = MaxSales)
)
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Create a measure like

DAX Peak time Calls 4 hours =
VAR TotalSalesPerHour =
    SUMMARIZE (
        'Aggregated Daily',
        'Aggregated Daily'[Time Hour],
        "TotalCalls", [Calls measure]
    )
VAR Result =
    CONCATENATEX (
        TOPN ( 4, TotalSalesPerHour, [TotalCalls] ),
        'Aggregated Daily'[Time Hour],
        ", ",
        [TotalCalls]
    )
RETURN
    Result

This will return more than 4 rows in the event of ties.

View solution in original post

3 REPLIES 3
nmckeown1
Helper II
Helper II

Following on from this above... if I now have the returned top 5 peak times of calls coming in. To also calculate the actual total number of calls, within the calculated top5 time frames: see below:

 

Peak time Calls 4 hours =
VAR TotalSalesPerHour =
SUMMARIZE (
'Aggregated Daily',
'Aggregated Daily'[Time Hour],
"TotalCalls", [Calls measure]
)
VAR Top4Hours =
TOPN ( 4, TotalSalesPerHour, [TotalCalls] )


VAR Top4HoursList =
SELECTCOLUMNS(Top4Hours, 'Aggregated Daily'[Time Hour])


VAR Result =
CALCULATE (
SUM('Aggregated Daily'[Calls measure]),
'Aggregated Daily'[Time Hour] IN Top4HoursList
)


RETURN
Result

johnt75
Super User
Super User

Create a measure like

DAX Peak time Calls 4 hours =
VAR TotalSalesPerHour =
    SUMMARIZE (
        'Aggregated Daily',
        'Aggregated Daily'[Time Hour],
        "TotalCalls", [Calls measure]
    )
VAR Result =
    CONCATENATEX (
        TOPN ( 4, TotalSalesPerHour, [TotalCalls] ),
        'Aggregated Daily'[Time Hour],
        ", ",
        [TotalCalls]
    )
RETURN
    Result

This will return more than 4 rows in the event of ties.

This worked perfect!!

Thank you

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.