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

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.

Reply
vicks
Frequent Visitor

How to Rank from multi category and Sum by TOP N Rank

HI all;

 

i have a dataset with dimdate relationship, i'd like to Rank my total revenue based on group0, year and month, i add Year and Month Column in dataset, because ranked should be in one table ( please correct me if i wrong),

i have wrong result, with my formula;

Ranked and sum.jpg

my question are;

1. how to ranked to get as my expected,

2. is it possible to ranked with different table ( e.q Year and Month from dimdate, Category and measure from dataset table

3. how to summ total revenue, from Top N Ranked ( should i used parameter,new column or table )

 

here is the link for my pbix

 

https://drive.google.com/open?id=1pDcPIgYbM72M8QgYPnYBBGiTI0G3rQtE

 

thank you for your help and share;

 

warm regards;

 

vick

1 ACCEPTED SOLUTION
vicks
Frequent Visitor

Hi All;

 

My issue was solved, now everything looks fine;

here is the formula to solved this

Rank Revenue By Month = RANKX(FILTER(ALL('RankByMonth'[Group0Desc],'RankByMonth'[Month]),'RankByMonth'[Group0Desc]=MAX('RankByMonth'[Group0Desc])),CALCULATE([Revenue Ttl]),,DESC,Dense)

 

and the sum for TOP N 

SUM TOP N = CALCULATE('RankByMonth'[Revenue Ttl],TOPN(SELECTEDVALUE('TOP Rank'[TOP Rank]),GROUPBY('RankByMonth',RankByMonth[Month]),CALCULATE([Revenue Ttl])))

Ranked - solved.jpg

here is the result

 

cheers;

 

vick

View solution in original post

1 REPLY 1
vicks
Frequent Visitor

Hi All;

 

My issue was solved, now everything looks fine;

here is the formula to solved this

Rank Revenue By Month = RANKX(FILTER(ALL('RankByMonth'[Group0Desc],'RankByMonth'[Month]),'RankByMonth'[Group0Desc]=MAX('RankByMonth'[Group0Desc])),CALCULATE([Revenue Ttl]),,DESC,Dense)

 

and the sum for TOP N 

SUM TOP N = CALCULATE('RankByMonth'[Revenue Ttl],TOPN(SELECTEDVALUE('TOP Rank'[TOP Rank]),GROUPBY('RankByMonth',RankByMonth[Month]),CALCULATE([Revenue Ttl])))

Ranked - solved.jpg

here is the result

 

cheers;

 

vick

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.