Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I need to place a rank based on the distinct number of mobile numbers. It is not working based on the formula below:
Formula used:
The ranks are all 1s.
My goal is to be able to show the rank per plan name based on the selected plan name on the left.
Solved! Go to Solution.
highly likely,
Services Count Rank =
RANKX (
ALLSELECTED ( 'Main Table'[FLEXIPLAN_NAME] ),
CALCULATE ( DISTINCTCOUNT ( 'Main Table'[MOBILE_NUMBER] ) )
)
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi @Anonymous
Since you can’t share sample file, so I create a sample based on your sample data, let’s discuss the problem on this file.
-
Create the measures:
Count of Mobile = DISTINCTCOUNT('Table'[Mobile Number])Rank = RANKX(ALL('Table'[Plan Name]), [Count of Mobile])
Result:
See sample file attached bellow.
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Since you can’t share sample file, so I create a sample based on your sample data, let’s discuss the problem on this file.
-
Create the measures:
Count of Mobile = DISTINCTCOUNT('Table'[Mobile Number])Rank = RANKX(ALL('Table'[Plan Name]), [Count of Mobile])
Result:
See sample file attached bellow.
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
highly likely,
Services Count Rank =
RANKX (
ALLSELECTED ( 'Main Table'[FLEXIPLAN_NAME] ),
CALCULATE ( DISTINCTCOUNT ( 'Main Table'[MOBILE_NUMBER] ) )
)
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi @CNENFRNL When I click on a particular plan name, the result of this foruma in the table become 1. It is accurate when I dont select any of the plan names.
When I select plan names:
all values are 1.
When I dont select plan names:
I need to show the rank in a card visual according to the rank of plan name by mobile number. But when I select a plan from the slicers, all of them becomes 1.
What if I want to introduce another variable in case there are ties?
@Anonymous
Can you share your sample data in text format? you can paste it in your reply here.
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi @Fowmy
I cannot post sample data since this is confidential. But the structure is:
I would also need to break ties in case there are ties. I want to introduce a third variable.
Thanks
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.