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
Shv
New Member

Issue with RankX function - giving Rank 1 for all the records of Month Name by Sales

I am trying to create a line chart for Top N Sales amount by Month.

When I use RankX function to Rank the Sales by Month Name it gives same rank for all 12 months.

 

Below is the DAX:

Rank_TopN = RankX(ALL(financials[Month Name]), Calculate(Sum(financials[Sales])), , Desc,Dense)

 

Any suggestions would be appreciated 🙂

Thanks!

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @Shv ,

 

Is Month Name a text string and being custom sorted by an other column? If so, include that in ALL as well.

https://www.sqlbi.com/articles/side-effects-in-dax-of-the-sort-by-column-setting/ 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
Shv
New Member

Hi @danextian ,

 

Thanks for the solution and quick response!
It worked 🙂

danextian
Super User
Super User

Hi @Shv ,

 

Is Month Name a text string and being custom sorted by an other column? If so, include that in ALL as well.

https://www.sqlbi.com/articles/side-effects-in-dax-of-the-sort-by-column-setting/ 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Europe Fabric Conference

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.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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