Forum Discussion
Anonymous
8 years agoNot applicable
Rank DAX Function
Hi I want to list the top 10 number of unique customers visited a representative with the customer representative's location. Without adding the location to the visual the rank works fine! ...
- 8 years ago
Hi Anonymous
You may try to use ALL function to avoid the Rank function from considering the location as below. If it is not your case, please share your data sample. Here are the references for you:
https://community.powerbi.com/t5/Desktop/RANKX-of-a-measure/td-p/231664
https://www.sqlbi.com/articles/use-of-rankx-in-power-bi-measures/
Rank_Cus_Representative = RANKX ( ALL ( Table1[Rep] ), CALCULATE ( DISTINCTCOUNT ( Table1[Customer_Id] ), ALL ( Table1[PCP_Location] ) ) )Regards,
Cherie
v-cherch-msft
8 years agoMicrosoft Employee
Hi Anonymous
You may try to use ALL function to avoid the Rank function from considering the location as below. If it is not your case, please share your data sample. Here are the references for you:
https://community.powerbi.com/t5/Desktop/RANKX-of-a-measure/td-p/231664
https://www.sqlbi.com/articles/use-of-rankx-in-power-bi-measures/
Rank_Cus_Representative =
RANKX (
ALL ( Table1[Rep] ),
CALCULATE (
DISTINCTCOUNT ( Table1[Customer_Id] ),
ALL ( Table1[PCP_Location] )
)
)Regards,
Cherie