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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.