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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tbennett93
Frequent Visitor

Filter pane behaves differently depending on selection and causes measure to not calculate - BUG?

I'm getting strange behaviour when I apply a 'not blank' filter to a FACT(ish) table, which is being filtered by slicers, one on a dimension table and one on a value in the FACT table. This example is for demonstration only, I know I need to use dimension tables; however, this is potentially highlighting an issue with Power BI itself.

 

I have this FACT type table:

tbennett93_0-1674128592702.png

 

With the DIM Area.ID in a one-to-many with the above table:

tbennett93_1-1674128622006.png

 

I want to display a table that presents all of the main table data plus a column which returns the sum of the score for the business. This column is defined by the measure:

Business Score = 
                CALCULATE(
                    SUM(QuestionScores[Score]),
                    'DIM Area'[Area] = "Business",
                    QuestionScores[Sub-Area]="Business"
                )

 

Now I add this to my table and apply filters on the Area and Sub-Area (this step is necessary):

tbennett93_2-1674128765373.png

 

Now in the filters pane, if I apply a filter on Sum of Score is not blank, nothing changes:

tbennett93_3-1674128846413.png

 

However, if I drag the Score column to the Filters pane for the visual (which we would think is identical to the above) and apply the same 'is not blank' filter. The measure breaks and doesn't display any information.

 

tbennett93_4-1674128958441.png

 

This persists, even if I delete the original filter:

tbennett93_5-1674128979205.png

 

 

And removing the filter lets the measure work again:

tbennett93_6-1674128996982.png

 

 

Interestingly. If I push the Sub-Area to its own dimension and rework the Business Score measure to filter by that, everything works no matter what visual filters are appled. Similarly, if the slicers on the left have no selected values, the measure works.

 

As such, this issue seems to be a combination of:

-Filtering by the main (fact) and dimension in the same measure, overwriting filters applied by slicers

-Adding a visual level filter on the Score column not being blank, by dragging the field in from the Fields pane

 

I know there are flaws with the model of this. It isn't a proper Star Schema and the fact is operating at multiple grains; however, this shouldn't affect how Power BI processes this sort of filter. 

 

I assume the issue lies in how Power BI applied filters as I cannot see any logical reason why this doesn't work.

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@tbennett93 , Try a measure like this and check

 

Business Score =
CALCULATE(
SUM(QuestionScores[Score]),
Filter('DIM Area', 'DIM Area'[Area] = "Business"),
Filter(QuestionScores, QuestionScores[Sub-Area]="Business")
)

This does not work, with or without the filters, as the first argument in FILTER doesn't clear the filters on the table and so the filter context clashes with 'Business' for all rows other than 'Business' in the table.

 

I have assumed you meant to say:

Measure2 = CALCULATE(
                SUM(QuestionScores[Score]),
                FILTER(ALL('DIM Area'[Area],'DIM Area'[Area]="Business"),
                FILTER(ALL(QuestionScores[Sub-Area]),QuestionScores[Sub-Area]="Business")
)
 
This also does not work and behaves the same way as my original measure.
 
 
 
 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.