Forum Discussion
Filter Context not propagating with IF function used in a measure
- 4 years ago
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" ) )
Hi tamerj1
Great explanation and I appreciate the diagram. We're on the same page that fact tables cannot filter dimensions and, dimensions can filter fact tables. There's no confusion around that. The way my measure is built is the issue because when I add Project ID, Business ID, and Date ID in a table and then add a slicer to slice by, let's say, Business Name, it filters perfectly. The issue occurs when I add fields from different dimensions in addition to my Volume Check measure.
This is how I always structure my data models and my measures work fine. I have never used an IF logic before which is why I think it's missing something.
How do I fix the measure to work correctly?
Anonymous
I don't think IF has anything to do with that. Place the measure [Volume] in the table and see what values you get.
again by placing a filter from another dim table you have changed the filter context. The values of the comparison measure will be diffrent (less)
- Anonymous4 years agoNot applicable
Hi tamerj1
Everything works as expected. I created a table to test by placing Project Number, Business Unit, and Launch Year (all fields from my dimensions) along with my Volume measure and filter context works as it should.
For reference, below is the calculation for Volume. One thing to note is that I like to branch my measures, so the "MASTER TOTAL" measure is simply a SUM of the values column in my fact table.
Volume =
CALCULATE(
[MASTER TOTAL],
'Activity Metrics Detail'[Line Item] = "Volume"
)
- tamerj14 years ago
Community Champion
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" ) )