Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be 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

Reply
pbininja
Frequent Visitor

Best Rank within category

Dear all,

 

So what I am looking at is finding out the highest/best Rank for the 'Social network' and the month which had this best Rank. Just attaching a sample data. The original data runs into a million rows for multiple months. Would want a measure ideally to calculate the measure, so that if I have a slicer to Social network and Gender, it would give me the best rank and for which month and the followers in that best ranked month.

 

Sample data:

MonthSocial NetworkGenderNew followers
Jan-20InstagramFemale90
Jan-20FacebookFemale87
Jan-20SnapchatFemale71
Jan-20TiktokFemale68
Jan-20TiktokMale99
Jan-20FacebookMale96
Jan-20InstagramMale95
Jan-20SnapchatMale81
Feb-20SnapchatFemale69
Feb-20FacebookFemale46
Feb-20InstagramFemale45
Feb-20TiktokFemale34
Feb-20FacebookMale94
Feb-20InstagramMale83
Feb-20TiktokMale31
Feb-20SnapchatMale29
Mar-20FacebookFemale86
Mar-20InstagramFemale73
Mar-20TiktokFemale55
Mar-20SnapchatFemale26
Mar-20InstagramMale93
Mar-20TiktokMale92
Mar-20SnapchatMale76
Mar-20FacebookMale41

 

Excepted result:

Social NetworkGenderBest RankMonth(Best Rank)Folowers (best Rnk mth)
FacebookFemale1Mar-2086
FacebookMale1Feb-2094
InstagramFemale1Jan-2090
InstagramMale1Mar-2093
TiktokFemale3Mar-2055
TiktokMale1Jan-2099
SnapchatFemale1Feb-2069
SnapchatMale3Mar-2076

 

Thanks in advance

 

Regards,

Nithish

3 REPLIES 3
pbininja
Frequent Visitor

Hey, 

 

Thanks for the replies Greg and Amit.

 

I am able to figure out the measure for the Rank. The problem is I am not able ascertain the best rank for the social networks and the month(best rank).

 

Please assist based on the sample data shared. 

 

Thanks.

 

Regards,

Nithish

amitchandak
Super User
Super User

@pbininja ,For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
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-3-of-3-the-finale

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Greg_Deckler
Super User
Super User

Seems like you need to do a RANKX and then a MINX or MAXX with appropriate filters.

 

Check out: https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452

 

and 

 

See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.