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
skytulip33
Frequent Visitor

Applying filter to measure but keep the rank as unfiltered. Is it possible?

I am wondering if it is possible to apply filter to the measure but still keep the rank as if no filter is applied?

 

For example:

 

itemvaluerank
a1001
b2002
c3003
d4004

 

the items are ranked using dax based on their value in ascending order.  What I want to do is to apply further filter and display only item "c" but still keep its rank. so the result should be:

 

itemvaluerank
c3003

 

Is this possible? 

 

Thank you guys.

1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @skytulip33

 

 Below is the rank measure and rank column for your reference. You may test and check if they could work. If it is not your case, could you explain which filter will be used? Please share more details for your scenario so that we could help further on it.

Rank = RANKX(ALL(Table1[item]),CALCULATE(SUM(Table1[value])),,ASC)
Column = RANKX(ALL(Table1),CALCULATE(SUM(Table1[value]),ALLEXCEPT(Table1,Table1[item])),,ASC,Dense)

1.png

 

Regards,

Cherie

 

 

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Maddy
Frequent Visitor

For multiple columns not working

 

My table like this

RsM Name' Psm Name 'ach% (measure)

 

Maddy
Frequent Visitor

For multiple columns not working

 

My table like this

RsM Name' Psm Name 'ach% (measure)

 

I want 2 ranks 1 dynamic and 1 overall rank static

 

v-cherch-msft
Employee
Employee

Hi @skytulip33

 

 Below is the rank measure and rank column for your reference. You may test and check if they could work. If it is not your case, could you explain which filter will be used? Please share more details for your scenario so that we could help further on it.

Rank = RANKX(ALL(Table1[item]),CALCULATE(SUM(Table1[value])),,ASC)
Column = RANKX(ALL(Table1),CALCULATE(SUM(Table1[value]),ALLEXCEPT(Table1,Table1[item])),,ASC,Dense)

1.png

 

Regards,

Cherie

 

 

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi @v-cherch-msft  thanks a lot for the solution. I took it for a problem I had an it somewhat solved it... the problem I am seeing now is that whenever I filter for the Rank 1 or Rank 2 (that is, the item that has rank 1 and 2 respectively), the rank automatically turns to 2 and 3. the rest of Ranks work well. i only have the issue with Rank 1 and 2 (or in this case negative 1 and 2 since they have negative profit)

 

do you know what could be causing it?

 

Picture1.pngPicture2.png

 

Here´s the Measure for the Rank:

 

var _result =
-1* RANKX (
     FILTER (
            ALL ( Unique_UI[Item], Unique_UI[Region])
            NOT ( ISBLANK ( [Profit]) )
             ),
     [Profit] , , 1
)
return
IF(HASONEVALUE(Unique_UI[Item]),_result, "")
 
 

 

Also, the Table Unique_UI includes columns for Region, country, and Item

 

Any help would be appreciated!

 

Alejandro

 

@v-cherch-msft

 

Thank you Cherie,

 

That is what I was looking for. I appreciate it!

JulietZhu
Helper IV
Helper IV

Sort vaule based on rank column. Is this you are looking for? If yes, go to data view --------> Modeling -----------> find value column ---------> sort by column (from here you can sort by any column you want).

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.