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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

More than one filter in RANKX

Hi,

 

Need help in adding 2 filters in RANKX and sorting by Date.

 

Column = RANKX (
FILTER (Table1, Table1[Topic] = EARLIER ( Table1[Topic] ) ), FILTER (Table1, Table1[ID] = EARLIER ( Table1[ID] ) )
Table1[Date].[Date],
ASC,DENSE
)

 

However , I get an error - he expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.

 

Any way to fix this?

 

Thanks

Shirin

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi @Anonymous 

 

To combine multiple filter conditions we can use && or || operators

 

Column =
RANKX (
    FILTER (
        Table1,
        Table1[Topic] = EARLIER ( Table1[Topic] )
            && [ID] = EARLIER ( Table1[ID] )
    ),
    Table1[Date].[Date],
    ,
    ASC,
    DENSE
)

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

Hi @Anonymous 

 

To combine multiple filter conditions we can use && or || operators

 

Column =
RANKX (
    FILTER (
        Table1,
        Table1[Topic] = EARLIER ( Table1[Topic] )
            && [ID] = EARLIER ( Table1[ID] )
    ),
    Table1[Date].[Date],
    ,
    ASC,
    DENSE
)

Hi @Zubair_Muhammad 
Excuse me, any idea of transform this formula in a measure? 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.