Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Experts,
I want to display only top 10 city and rest of the city should be display as "others". I want to show in pie chart where only 11 values should be display top 10 city +other values.
I am not able to set rank to my city column. it is showing all 1 rank to all city.
Thanks in advance.
Solved! Go to Solution.
hi @Uzi2019
Try this formula to create a column
regionrank = VAR a= RANKX(Facebook,CALCULATE(SUM([Impressions]),ALLEXCEPT(Facebook,Facebook[Region])),,DESC)
return
IF(a>=11,"Others",Facebook[Region])
or
regionrank =
VAR a= RANKX(Facebook,CALCULATE(SUM([Impressions]),FILTER(Facebook,Facebook[Region]=EARLIER(Facebook[Region]))),,DESC)
return
IF(a>=11,"Others",Facebook[Region])
If not your case, please share your sample pbix file for us have a test.
Regards,
Lin
HI @Uzi2019 ,
Create a calculated Column
Create another Calculated Column
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @Uzi2019 ,
Use this measure
Ranking =
var a = RANKX(ALL('Table'[Region]), Calculate (Sum('Table'[Impressions]))
RETURN
IF (a>10, "Others", CONVERT(a,STRING)
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Thanks a lot for your answer. It's working as expected but unable to display in pie chart.
Because Your given measure is not added into "Legend" property of Pie chart.
Please assist further as we are almost close.
@Uzi2019 ,
I do not think that you can use measures in Legend of a pie chart.
You have to create a Calculated Colum incase you want to use this as a legend.
Regards,
Harsh Nathani
@Uzi2019 ,
Rank Column =
var a = RANKX(Table', Calculate (Sum('Table'[Impressions]))
RETURN
IF (a>10, "Others", CONVERT(a,STRING)
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
I tried your Rank Column but it gives me circular dependency.
I replaced ALL with ALLSELECTED so circular dependency has removed. but not showing "Others" values in calculated column.
HI @Uzi2019 ,
Create a calculated Column
Create another Calculated Column
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Thank you so much. it really solved my issue..
hi @Uzi2019
Try this formula to create a column
regionrank = VAR a= RANKX(Facebook,CALCULATE(SUM([Impressions]),ALLEXCEPT(Facebook,Facebook[Region])),,DESC)
return
IF(a>=11,"Others",Facebook[Region])
or
regionrank =
VAR a= RANKX(Facebook,CALCULATE(SUM([Impressions]),FILTER(Facebook,Facebook[Region]=EARLIER(Facebook[Region]))),,DESC)
return
IF(a>=11,"Others",Facebook[Region])
If not your case, please share your sample pbix file for us have a test.
Regards,
Lin
Please find the pbix file on below link..
https://drive.google.com/file/d/1nNSktMkDxrgLyyz0fZCnZwJxjOgyPrTw/view?usp=sharing
@Uzi2019 ,
Please share you pbix or sample data.
Upload on One Drive or share via Google Drive.
Regards,
Harsh Nathani
@Uzi2019 for rank , read these posts
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
and for top 10, check this post, hope it helps
https://community.powerbi.com/t5/Desktop/Top-10-Other/td-p/51282
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
I am unable to figure out how to get 11th value as "others" value in cloumn with top 10 values..
I got the rank but unable to find the next step to calculate "Others".
When I apply below DAX it gives me error:
@Uzi2019 ,
You will need to convert the numeric rank value to Text.
var a = RANKX(ALL('Table'[Region]), Calculate (Sum('Table'[Impressions]))
RETURN
IF (a>10, "Others", CONVERT(a,STRING)
Regards,
Harsh Nathani
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
80 | |
67 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |