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
badger123
Resolver I
Resolver I

Calculate Filter Ignoring in Table visual

Something strange is happening with my measure and I can't figure out why / what I need to do to make it work properly. Any advice would be great. I have a table, simplified below, and on the page there is a slicer for country. I am using a table visual to display the items for the selected country and also price, with the correct currency. 

 

CountryItemPriceCurrency
1AAA100GBP
1BBB200GBP
2CCC300USD
2DDD200USD
2EEE100USD

 

My measure currently looks like this, where Measure1 is a simple average(price) measure. When I add this measure as a field to the table visual it displays the items from all countries, just with blanks in this column. 

 

Measure2= 
VAR SelectedCountry = 
    SELECTEDVALUE(Table 1[country])
RETURN
IF(SelectedCountry=1,Format([Measure1],"£0.00"),Format([Measure1], "$0.00"))

I have tried using various filters but have had no success. Any ideas? 🙂 

1 ACCEPTED SOLUTION

I'm not quite sure I understand. You want to only return the average if the price is not blank? If that's the case, you can either use a visual filter or inside your measure do something like this:

CALCULATE(AVERAGE(Table1[Price]), Table1[Price] <> BLANK())


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

3 REPLIES 3
hnguy71
Super User
Super User

It's working for me:

 

MyMeasure = 
var avgPrice = AVERAGE(Table1[Price])
var SelectCountry = SELECTEDVALUE(Table1[Country])
Return
IF(SelectCountry = 1, FORMAT(avgPrice, "£0.00"), FORMAT(avgPrice, "$0.00"))

avg_price.PNG



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

@hnguy71 thanks for helping 🙂 unfortunately it's still not working for me, having tried a few different things. The only reason I can think of is because of blanks in my Price column? 

I'm not quite sure I understand. You want to only return the average if the price is not blank? If that's the case, you can either use a visual filter or inside your measure do something like this:

CALCULATE(AVERAGE(Table1[Price]), Table1[Price] <> BLANK())


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

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.