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
Anonymous
Not applicable

RANKX by Product by Value (multiple categories)

Hi Experts

 

How would you rank products based on the values in the data set. See images below i have ranked each product based on the values for that products so each product group has its own ranking. (if that makes any sense). 

 

Capture.PNG

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Refer

https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures

 

Ranking by Sub Category = 
	RANKX (
		FILTER(
			ALL(
				'Table'[Category],
				'Table'[Sub Category]
				),
			'Table'[Category] = MAX('Table'[Category])
			),
			CALCULATE(SUM('Table'[My Value]))
			)

 

View solution in original post

5 REPLIES 5
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create columns

rank = RANKX(FILTER('Table','Table'[product]=EARLIER('Table'[product])),[value],,ASC,Dense)

Capture6.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

THanks you maggie and god bless...

amitchandak
Super User
Super User

Refer

https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures

 

Ranking by Sub Category = 
	RANKX (
		FILTER(
			ALL(
				'Table'[Category],
				'Table'[Sub Category]
				),
			'Table'[Category] = MAX('Table'[Category])
			),
			CALCULATE(SUM('Table'[My Value]))
			)

 

Anonymous
Not applicable

Hi Amit

 

i need to add this as calculated column....into a table..

Anonymous
Not applicable

silly question whats Category and sub Category from my example...

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.