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
youconnect
Helper I
Helper I

Ranking ignoring Market(category)

Hi,

I have this DAX 

RANKX(ALL(users_table;CALCULATE(SUM(sales_table_sales);;DESC)

And my output is:
idUserSalesRank
56100001
5590002
21450003
5945004
87426005
6820006
96519007
5718008
6315009
54100010

But if I add the Market to the visual table the result is this:
idUserSalesMarketRankRank Expected
5610000alpha11
559000beta12
2145000zeta13
594500zeta24
8742600beta25
682000alpha26
9651900alpha37
571800beta38
631500zeta39
541000alpha410

Can you help me?
Thanks in advance.
6 REPLIES 6
Anonymous
Not applicable

Create two measures like:

sum sales = SUM('Table'[Sales])
rank= RANKX(all('Table'),[sum sales],,DESC)
'rank' measure will give the desired output.
 
 
v-lionel-msft
Community Support
Community Support

Hi @youconnect ,

Could you give me a sample data model?

I need to know which columns do users_ table and sales_table have?and what's the relationship between the two tables?

 

Best Regards,
Lionel Chen

 

@v-lionel-msft here you have pbix file

https://we.tl/t-qUSAEUvTcg

 

Help me please

amitchandak
Super User
Super User

The formula you provided, seems to have a issue.

I think it should be created as a column not measure.

Refer

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

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

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

@amitchandak 

Thanks for your respose.
I already saw the articles but without sucess.

 

Anybody can help me?

Thanks

 

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.