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

View all the Fabric Data Days sessions on demand. View schedule

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]))
			)

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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]))
			)

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors