Forum Discussion

gambleave's avatar
gambleave
Helper II
4 years ago
Solved

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 th...
  • Jihwan_Kim's avatar
    4 years ago

    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.

     

     

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