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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous999
Frequent Visitor

Multiple measure-based ‘Filters on this visual’ happening out of order

My Data (table DT):

Location ID

Location Name

Date

WeekStarting

Week No.

Column ID

Open Units

Available Units

1

Location A

01-Jan-2024

31-Dec-2023

1

1

51

100

1

Location A

01-Jan-2024

31-Dec-2023

1

2

55

100

1

Location A

01-Feb-2024

28-Jan-2024

5

1

61

100

1

Location A

01-Feb-2024

28-Jan-2024

5

2

65

100

1

Location A

09-Feb-2024

04-Feb-2024

6

2

81

100

1

Location A

01-Mar-2024

25-Feb-2024

9

1

71

100

1

Location A

01-Mar-2024

25-Feb-2024

9

2

75

100

2

Location B

02-Feb-2024

28-Jan-2024

5

1

52

100

2

Location B

02-Feb-2024

28-Jan-2024

5

2

56

100

2

Location B

02-Mar-2024

25-Feb-2024

9

1

62

100

2

Location B

02-Mar-2024

25-Feb-2024

9

2

66

100

2

Location B

02-Apr-2024

31-Mar-2024

14

1

72

100

2

Location B

02-Apr-2024

31-Mar-2024

14

2

76

100

2

Location B

10-Apr-2024

07-Apr-2024

15

2

82

100

3

Location C

03-Mar-2024

03-Mar-2024

10

1

53

100

3

Location C

03-Mar-2024

03-Mar-2024

10

2

57

100

3

Location C

03-Apr-2024

31-Mar-2024

14

1

63

100

3

Location C

03-Apr-2024

31-Mar-2024

14

2

67

100

3

Location C

03-May-2024

28-Apr-2024

18

1

73

100

3

Location C

03-May-2024

28-Apr-2024

18

2

77

100

3

Location C

11-May-2024

05-May-2024

19

2

83

100

 

I also have the following measures:

SelectedWeekStart = SELECTEDVALUE(DT[WeekStarting])

 

LocationDateRank = RANKX( FILTER(ALLSELECTED(DT),

                                               DT[Location ID]=SELECTEDVALUE(DT[Location ID])),

                                               [SelectedWeekStart],,ASC,Dense )

 

DT% = SUM(DT[Open Units]) / SUM(DT[Available Units])

 

When looking at the rankings at the week-level without any filtering/slicing, everything looks good:

Anonymous999_0-1717529142752.png

 

Next, when filtering on DT% >= 65% (via Filters on this Visual), the dynamic LocationDateRank is still correct:

Anonymous999_1-1717529142755.png

 

But, when I also add LocationDateRank <= 2 to the ‘Filters on this Visual’ pane, the results are incorrect:

Anonymous999_2-1717529142756.png

 

I want the result to be:

Anonymous999_3-1717529142758.png

 

It seems the two measure-based filters are happening out of order (i.e., it is first applying LocationDateRank <=2 and then the DT%<= 65%). Changing the order of the filters listed in the ‘Filters on this visual’ pane has no effect.

How can I fix this so the LocationDateRank filter is applied last?

4 REPLIES 4
Anonymous999
Frequent Visitor

In this case, the users will always expect the ranking to occur after all other filters (except the Rank filter itself) are applied. Once the filtered rows are ranked, they then want to only show the top X ranks per Location. I just don't know how to accomplish this.

lbendlin
Super User
Super User

What's the purpose of

 

 

LocationDateRank = RANKX( FILTER(ALLSELECTED(DT),

                                               DT[Location ID]=SELECTEDVALUE(DT[Location ID])),

                                               [SelectedWeekStart],,ASC,Dense )

 

 

Are you trying to find out the ROWNUMBER?

 

Both DT% and LocationDateRank seem to be immutable, and can thus be created as calculated columns.

Thanks for the reply Ibendlin.

LocationDateRank is essentially the row number but is dynamic based upon the filters that have been applied. You'll notice that in the second screenshot (i.e., the one that shows the DT%>65% result), the rank (or row number) has changed from the 1st screenshot. Location A's two rows in the 2nd screenshot are numbered 1 and 2, but they were originally rows 3 and 4 in the first screenshot. 

 

DT% will also vary depending on aggregation and filters. The original column data includes a Column ID, which is the lowest level that downtime % is calculated. But when aggregating irrespective of Column ID or the WeekStarting date, the DT% can be different.

 

Hope this helps to clarify.

so you have two moving targets .  That will likely result in ranking changes.  You would need to define your expected result and then materialize the measures accordingly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.