Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

RANKX not Dynamically Changing Based on Selected Date/Time Filters

I have two calulated columns that I use to display my top Cluster Ids by Cost. The top 10 Cluster Ids are displayed and the rest are thrown into "Other Cluster Ids". When filtering this view based on time, it does not dynamically change. For example, it will show me the correct Cluster Ids for the total date range, but when I filter the time range to the current week, it will continue to display those top Cluster Ids instead of dynamically changing to the ones that are the most for that week. Here are my my calculated columns:

Cluster Id Rank = RANKX(
    ALL( azure_amtz_aggr_cost[ClusterId] ),
    CALCULATE( SUM( azure_amtz_aggr_cost[Cost] ), ALLEXCEPT( azure_amtz_aggr_cost, azure_amtz_aggr_cost[ClusterId] ) )
)
Cluster Id Rank Value = IF(azure_amtz_aggr_cost[Cluster Id Rank] <= 10, azure_amtz_aggr_cost[ClusterId], "Other Cluster Ids")

 

1 Reply

  • Anonymous , the calculated column can not change with slicer value, you have to create a measure and measure rank

     

    Example measure

     

    Cluster Id Rank = RANKX(
    ALLSELECTED( azure_amtz_aggr_cost[ClusterId] ),
    CALCULATE( SUM( azure_amtz_aggr_cost[Cost] ), ALLEXCEPT( azure_amtz_aggr_cost, azure_amtz_aggr_cost[ClusterId] ) )
    )


    Cluster Id Rank = RANKX(
    ALLSELECTED( azure_amtz_aggr_cost[ClusterId] ),
    CALCULATE( SUM( azure_amtz_aggr_cost[Cost] ) ) )