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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Rank column in a table visualization with multiple categories coming from different sources

Hello !

 

I would like to have a rank column in my table. I know that I have to use rankx but here is the difficult point : I have created a relation between 2 sources based on the sku, and now I would like to rank but in my table I have dimensions coming from my source 1 and my source 2.

 

Here is a visual example :

 

Capture.PNG

 

So in my source 1 I have for example the field : sku, gender, color and sales

In the source 2 I have : sku and type

I have created a relation between the two tables based on the sku key.

 

An important point : I have contextual filters so the rank measure should change each time the filter value change.

 

How would you do that ?

 

Thanks guy !

1 ACCEPTED SOLUTION

@Anonymous , sorry , it should be Type

 

rankx(summarize(allselected(source1), sources2[SKU], source1[gender],source1[color], source1[Type]) , [sales],,desc, dense)

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

4 REPLIES 4
jnguyen21
Helper I
Helper I

Thank you for your suggestion. I was running into a similar issue and this measure worked perfectly

Anonymous
Not applicable

Hello @amitchandak, thanks for the anwser 🙂

 

But Source 1 and source 2 are two different sources so I don't understand how this part : source1[source2]

could work. Source 2 is not a column of the source 1.

@Anonymous , sorry , it should be Type

 

rankx(summarize(allselected(source1), sources2[SKU], source1[gender],source1[color], source1[Type]) , [sales],,desc, dense)

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
amitchandak
Super User
Super User

@Anonymous , You have to create a measure rank

 

rankx(summarize(allselected(source1), sources2[SKU], source1[gender],source1[color], source1[source2]) , [sales],,desc, dense)

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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