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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
gambleave
Helper II
Helper II

RANKX with table aggregation

Looking for help with the RANKX function, where table aggregation is required as an intermediate step. 

With a data table as illustrated below, I want to achieve a rank of Business Group based on the total activity duration associated with each Business Group. There are some duplicated Activity ID records in the data set to attribute multiple employees in some activity records. 

 

I was thinking it involved a SUMMARIZE measure nested in the RANKX, but can't seem to get this working. Help appreciated. 

 

rankx.png

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your expected outcome looks like, but please check the below picture and the attached pbix file.

It is for creating a measure.

 

Untitled.png

 

Rank by activity duration measure: = 
IF (
    HASONEVALUE ( Data[Business Group] ),
    RANKX (
        ALL ( Data[Business Group] ),
        CALCULATE ( SUM ( Data[Activity Duration] ) ),
        ,
        DESC
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your expected outcome looks like, but please check the below picture and the attached pbix file.

It is for creating a measure.

 

Untitled.png

 

Rank by activity duration measure: = 
IF (
    HASONEVALUE ( Data[Business Group] ),
    RANKX (
        ALL ( Data[Business Group] ),
        CALCULATE ( SUM ( Data[Activity Duration] ) ),
        ,
        DESC
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thank you very much for your help!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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