March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi PBI Forum,
Trying to simplify a former post. Here is what I'm trying to do, but first, the data:
Table Name: Members
Sample Data Below
MemberID CBSA_Abb
12345 National
56789 National
01234 National
09876 Los Angeles Metro Area
54321 Los Angeles Metro Area
01923 Chicago Metro Area
Members each have a MemberID that is unique. I've created a measure to calculate the unique members:
# Member Month Count = CALCULATE(DISTINCTCOUNT([Members[MemberID]))
This measure gives me 6 unique members.
In a table, the data now show the following:
CBSA_Abb # Member Mount Count
National 3
Los Angeles Metro Area 2
Chicago Metro Area 1
I now want to create a RankX formula that creates a measure called "CBSA Rank". In essence, the final table will show the following:
CBSA_Abb CBSA Rank
National 1
Los Angeles Metro Area 2
Chicago Metro Area 3
I'm looking to create this measure first.
==================================================
The second measure I'm looking to create involves text. What I'd like to be able to do is create a text string measure such as the following:
Display Top 3 CBSA by Members = "The top 3 CBSAs are "& (measure to show National, Los Angeles Metro, Chicago).
Any assistance? Appreciate the help!
Solved! Go to Solution.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Thanks Allison,
Would you be able to suggest a RANKX formula to use?
See attached sample file (below signature) and see the formulas below. Couple of things to note:
Try these:
Count of Members = DISTINCTCOUNT('Members'[MemberID ])
CBSA Rank = RANKX(DISTINCT(all('Members'[CBSA_Abb])), [Count of Members])
Top 2 = "The top 2 CBSAs are: " & CONCATENATEX(FILTER(ALL('Members'[CBSA_Abb]), [CBSA Rank]<=2),'Members'[CBSA_Abb], ", ")
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi Again Allison,
How can I make the contatenate display the following text: The top 3 CBSAs by population are: National, Los Angeles, and Chicago.
(Note, National, Los Angeles, and Chicago are in order by population).
I created this formula:
Top 3 CBSAs =
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Thanks Allison, yes there is a blank issue, but it's stemming from some missing data in another table that was just fixed.
I created this formula and it works wonderful. Thanks for your help!
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
146 | |
97 | |
79 | |
69 |