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
andy1884
Frequent Visitor

RANKX based on fact and dimesion table

Apologies in advance for a seemingly stupid question - I've only just started (1 day) with Power BI having previously used Cognos Analytics.

 

Simple case - I have a dimension table for stores which has an Area Manager on it. I then have a fact table with summary sales by store by week. Both are joined with a relationship pon the Store ID

What I want is a ranked list of Area Managers based on the Gross Sales. The list works fine, but adding a Rankx just shows all 1.

The command I'm using is 

RankofGross = rankx(allselected(Dim Table[AreaManager]),calculate(SUM(Fact Table[GrossValue])))

 

I've seen lots of posts with variations of this command with all, allselected and nothing at all and also RELATED, so I'm a little lost - any help appreciated, must be a simple fix, right?

1 ACCEPTED SOLUTION

sorted...needs to be a measure column

View solution in original post

2 REPLIES 2
andy1884
Frequent Visitor

can't be that hard can it ?

In the model below, I would want to rank Name (from Customers) by sales value (from Sales).

 

Am I missig something fundamental like all data has to be on a single query for it work.

 

Capture.JPG

sorted...needs to be a measure column

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.