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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
quentinjs
Regular Visitor

RankX Desc w/ filter works but ASC does not.

I have a table visual, with 2 ranking columns.  The ranking looks correct in the table for both ascending and descendingm there are no gaps.  When I add a filter of QJS_Rank_RegEXP (RankX Desc) < 10 it works but when I use TA (RankX ASC) measure witt the same visual filter the table has no resultnig rows.

 

table_both_cols.png

 

Showing the table with the filter on QJS_TA applied.  Also if I change the QJS_TA filter to greater than 10,  get all the rows

table with fiter.png

 

My measures are:

 

QJS_Rev =

Extract'[DtlVal (Flipped Sign)]))

 if(max('_Cost Type'[Type])="Gross",

    CALCULATE ( SUM (  GrossGL[GrsVal]),

   

        'Fin Hierarchy'[SysFinClsName_Level1] = "Revenue")

     

       , // ELSE

       

       CALCULATE (

    SUM (  'GL Extract'[DtlVal (Flipped Sign)] ),

   

        'Fin Hierarchy'[SysFinClsName_Level1] = "Revenue")      

    )

 

 

QJS_Exp =

 

 if(max('_Cost Type'[Type])="Gross",

     ABS(CALCULATE ( SUM (  GrossGL[GrsVal]),

   

        'Fin Hierarchy'[SysFinClsName_Level1] = "Expenses") ) //)

     

        , // ELSE

         

     abs(CALCULATE ( SUM (  'GL Extract'[DtlVal (Flipped Sign)] ) ,

         

        'Fin Hierarchy'[SysFinClsName_Level1] = "Expenses"

      )) //)

      )

 

QJS_RevExp =

var _exp = [QJS_Exp]

var _Rev = [QJS_Rev]

return if (_Exp > 0, _Rev / _Exp, Blank() )

 

 

QJS_TA =

    if (  ISINSCOPE ('Prop Hierarchy - Wellsite'[L5Name] ),

             RANKX(AllSelected('Prop Hierarchy - Wellsite'[L5Name] ), [QJS_RevExp],,ASC)

    )

 

 

 

QJS_Rank_RevExp =

    if (  ISINSCOPE ('Prop Hierarchy - Wellsite'[L5Name] ),

             RANKX(AllSelected('Prop Hierarchy - Wellsite'[L5Name] ), [QJS_RevExp],,DESC)

    )

 

 

 

Thanks in advance!!

 

 

2 REPLIES 2
quentinjs
Regular Visitor

I tried making a sample, but it worked perfectly, so I then reduced the dashboard, to only the one table.  Didn't help, but got rid of the potential.  

 

I have an ascending rank, and 2 filters on the visual that say Exp > 0.01 and Rev > 0.01.  The visual shows the ranking starting at 1 and going to like 3000+.  Once I set Rank < 11 the grid shows nothing.  If I make it < 20 it shows 3 records and <50 I get 34 records.  Its almost like it applies the Rank filter first and then the 2 other filters and then re-runs the rank for the visual. That seems crazy but is that how PBI behaves?

 

If I then remove the > 0.01 from Rev I get a set of rows that match the rank limit.

 

If this is true, how do I get thhe visual to apply filters such that Rank is the last filter applied?

 

The reason I say re-applies the rank is because it starts at 1, and for the case where the filter is < 20 it has 1,2,3 and 4.

Anonymous
Not applicable

Hi @quentinjs 

 

To provide better help, you can share the pbix file or provide some dummy data. It is best to present it in a tabular form. Take care to remove sensitive information.

 

Regards,

Nono Chen

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors