cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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."
Connect to me on LinkedIn || Need consulting? Hire me for a Power BI gig on UpWork.
Learn with me on YouTube @PowerBITambayan.

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."
Connect to me on LinkedIn || Need consulting? Hire me for a Power BI gig on UpWork.
Learn with me on YouTube @PowerBITambayan.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors