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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
bhumikasardana
Frequent Visitor

Rankx gives all 1

Hi,

I need to add measure called RankSeries to rank each series by its viewing figures to get following output

1.JPG

Upon using this DAX formula ,
RankSeries = RANKX(ALL(Series),CALCULATE(SUM(Series[Viewers (m)])),,ASC)

Goal is achieved but when I replace Table-> All(series) with Column All(Series[Series]) , i.e

RankSeries = RANKX(ALL(Series[Series]),CALCULATE(SUM(Series[Viewers (m)])),,ASC)

value for the same comes out as 

2.JPG

I don't understand why ?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@bhumikasardana , if you add any other column than the column in Rank, that rank will be inside that column/s that is why the second rank behaves like that

 

you need add all columns in visual

RankSeries = RANKX(ALL(Series[Series], Series[channel], Series[episode] ,Series[timeslot]) ,CALCULATE(SUM(Series[Viewers (m)])),,ASC)

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @bhumikasardana ,

ALL used as a filter argument is filter modifier. It removes the filter on its argument.

When the argument is a table, it removes the filter over the entire expanded table (the table specified as argument). Whent the argument is one or more columns, it removes the filters over the specified columns.

Filter removals happen during the fourth step in the CALCULATE execution, after the context transition and before the expression evaluation

The explanation of the CALCULATE execution step can be found in the DAX Guide

In the Measure 1, all filters are removed from the Series table. In the Measure 2, only the filter existing over Series[Series] is removed

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@bhumikasardana , if you add any other column than the column in Rank, that rank will be inside that column/s that is why the second rank behaves like that

 

you need add all columns in visual

RankSeries = RANKX(ALL(Series[Series], Series[channel], Series[episode] ,Series[timeslot]) ,CALCULATE(SUM(Series[Viewers (m)])),,ASC)

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Okay, so basically when I select All(tablename) inside rankx, irrespective of other column my values won't be alter.But, if I select a All(columnname) then upon adding more columns in visual my rank would be affected?How do I know what to use when?i.e it should be All(Tablename) or All(Columname)?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.