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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
nguyendaithang
Frequent Visitor

Rank sales of each province

Hi every one

 

I have a problem with rank as below. I have a below table with 5 provinces, each province apprears differently (1,2 or rows)

So I must ranks sales based on province as belows. Example: Province A has 3 rows of sales: 70,51,78 => Equivalent Rank: 2,3,1

Therefore I need a DAX formula for rank this table

 

Thank you very much!

 

PROVINCESALESRANK
A702
B231
A513
C342
D292
D141
B262
E221
A781
C221
1 ACCEPTED SOLUTION
joshcomputer1
Helper V
Helper V

Try this as a calculated column:

Rank = rankx(filter(table1, Table1[province]= earlier(Table1[province])),table1[sales])

 

ss1.PNG

View solution in original post

3 REPLIES 3
joshcomputer1
Helper V
Helper V

Try this as a calculated column:

Rank = rankx(filter(table1, Table1[province]= earlier(Table1[province])),table1[sales])

 

ss1.PNG

waw, that works perfectly

Thank you very much!

Baskar
Resident Rockstar
Resident Rockstar

@nguyendaithang

 

Try this.

 

Rank = RANKX(Filter('Rank', 'Rank'[PROVINCE] = EARLIER('Rank'[PROVINCE])),'Rank'[SALES],,DESC,Dense)

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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