Showing results for 
Search instead for 
Did you mean: 
G_R_S Occasional Visitor
Occasional Visitor

Dynamic Ranking that considers a visual filter in its calculation



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



    FILTER (


            ALLSELECTED ( 'Query1' ),

            "index", 'Query1'[Index],

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


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





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.




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

Moderator v-yuezhe-msft

Re: Dynamic Ranking that considers a visual filter in its calculation


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.

Lydia Zhang

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

Helpful resources

Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 33 members 964 guests
Please welcome our newest community members: