Forum Discussion
Filter Context not propagating with IF function used in a measure
Hi All,
Having an issue with a basic IF logic used in a measure. My IF statement is as follows:
Volume Check =
IF(
[Volume] > 10000,
"Flag",
"Ok"
)
The measure works and my table visual does what I want:
| Project Name | Launch Date | Project Number | Volume Check |
| A | 10/15/2020 | 12345 | Ok |
| B | 1/5/2025 | 24690 | Ok |
| C | 4/7/2024 | 49380 | Flag |
| D | 4/1/2024 | 98760 | Ok |
| E | 4/10/2023 | 19752 | Ok |
| F | 4/8/2024 | 39504 | Ok |
| G | 4/3/2023 | 79008 | Flag |
My issue occurs when I drag a field into the table visual from one of my other lookup tables. Example: if I drag in the "Business Name" field from the Business table it repeats everything like you would see if a relationship did not exist between lookup and source tables. The table looks as follows:
| Business | Project Name | Launch Date | Project Number | Volume Check |
| Business 1 | A | 10/15/2020 | 12345 | Ok |
| Business 2 | A | 10/15/2020 | 12345 | Ok |
| Business 3 | A | 10/15/2020 | 12345 | Ok |
| Business 1 | B | 1/5/2025 | 24690 | Ok |
| Business 2 | B | 1/5/2025 | 24690 | Ok |
| Business 3 | B | 1/5/2025 | 24690 | Ok |
| Business 1 | C | 4/7/2024 | 49380 | Flag |
| Business 2 | C | 4/7/2024 | 49380 | Flag |
| Business 3 | C | 4/7/2024 | 49380 | Flag |
| Business 1 | D | 4/1/2024 | 98760 | Ok |
| Business 2 | D | 4/1/2024 | 98760 | Ok |
| Business 3 | D | 4/1/2024 | 98760 | Ok |
| Business 1 | E | 4/10/2023 | 19752 | Ok |
| Business 2 | E | 4/10/2023 | 19752 | Ok |
| Business 3 | E | 4/10/2023 | 19752 | Ok |
| Business 1 | F | 4/8/2024 | 39504 | Ok |
| Business 2 | F | 4/8/2024 | 39504 | Ok |
| Business 3 | F | 4/8/2024 | 39504 | Ok |
| Business 1 | G | 4/3/2023 | 79008 | Flag |
| Business 2 | G | 4/3/2023 | 79008 | Flag |
| Business 3 | G | 4/3/2023 | 79008 | Flag |
The issue is not my data model. I believe I need to force the filter context with my IF measure. Does anyone know what I am doing wrong here and how I can fix this issue? Thank you!
Anonymous
You can modify your measure
Volume Check = IF ( [Volume] > 10000, "Flag", IF ( [Volume] > 0, "Ok" ) )
or
Volume Check = IF ( NOT ISBLANK ( [Volume] ), IF ( [Volume] > 10000, "Flag", "Ok" ) )
11 Replies
- tamerj1
Community Champion
Anonymous
When adding columns from different tables the engine creates a cross join table generating all possible unique combinations. Allways add columns as measures perhaps using SELECTEDVALUE
- AnonymousNot applicable
Hi tamerj1
Thank you for the response! What would the DAX look like for this combined with my measure above?
- tamerj1
Community Champion
It depends on your data model. Can you please share a screenshot of you data model and the expected results table indicating the the table to which each column belongs.