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
G_R_S
New Member

Dynamic Ranking that considers a visual filter in its calculation

Hello,

 

We are trying to create a Ranking measure on a date column. We are using the ALLSELECTED function in the measure's calculation as below

RANK = 

MINX (

    FILTER (

        SELECTCOLUMNS (

            ALLSELECTED ( 'Query1' ),

            "index", 'Query1'[Index],

            "rank", RANKX ( ALLSELECTED ( 'Query1' ), 'Query1'[Eff_start_date],, DESC, DENSE )

        ),

        [index] = MAX ( 'Query1'[Index] )

    ),

    [rank]

)

 

On the dashboard we have a date filter which brings in data upto the selected date. In addtion to this, we have created a Flag measure, which changes its value to 'Y' for all the dates less than the selected date in the filter.

 

 

Our requirement is that, we need to filter the table visualization having visual filter Flag as 'Y' and Rank as '1'. We can see the required values in the table visualization when no filter is applied.

 

The issue we are facing is that, although the Rank is displayed as '1' and Flag as 'Y' in the table visualization, when we apply them as visual filters to eliminate the other values, we notice that the Ranking measure is ignoring the Flag filter in its calculation. This is because, the ALLSELECTED function doesn't consider a visual filter in it calculation.

 

Query.png

 

Is there a way in which we can use a measure as a slicer which would also be considered in the Ranking? Any other suggestion is also welcomed

1 REPLY 1
Anonymous
Not applicable

@G_R_S,

Could you please share raw data of your table and post expected result in table? Also we need to know what formula you use to create the Flag measure.

Regards,
Lydia Zhang

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