Forum Discussion
DAX measures not filtering as expected
OK DAX gurus, I am having an issue with a technique I was trying to use to display currency symbols based on slicer selected. Here is my current setup:
I have 3 slicer that show our CONTINENT, MARKET, and COUNTRY. I have uploaded the sample data for testing. What I am attempting to do is show the symbol based on the slicer selection. First, I created measures for each slicer to display the symbol based on the selection in the slicer. Here is the DAX for that:
country_m = IF(HASONEVALUE ( 'DimLocation'[Country] ), VALUES ( 'DimLocation'[Country Symbol] ), "-")
continent_m = IF(HASONEVALUE ( 'DimLocation'[Continent] ), VALUES ( 'DimLocation'[Continent Symbol] ), "-")
market_m = IF(HASONEVALUE ( 'DimLocation'[Market] ), VALUES ( 'DimLocation'[Market Symbol] ),"-")
Then, I created a measure to display on a card visual, which my goal was to show the symbol based on the slicer selection as stated above.
Label =
IF (
ISFILTERED ( 'DimLocation'[Continent] ),
[continent_m],
IF (
ISFILTERED ( 'DimLocation'[Market] ),
[market_m],
IF ( ISFILTERED ( 'DimLocation'[Country] ), [country_m], " " )
)
)This does not work as intended. As you can see from the below screenshot, you should be seeing the symbol at the country level, but it is showing the market or continent level.
- Anonymous7 years ago
Well, I'm a doofus. The solution is to reverse the order of conditions ... simple and solved my problem!
Label 1 = IF ( ISFILTERED ( 'DimLocation'[Country] ), [country_m], IF ( ISFILTERED ( 'DimLocation'[Market] ), [market_m], IF ( ISFILTERED ( 'DimLocation'[Continent] ), [continent_m], " " ) ) )
3 Replies
- AnonymousNot applicable
Hi Anonymous,
This issue should related to your dax formula.
According to your snapshot, I think all of if statement conditions can passed. If this is a case, it only return first condition result instead output correspond level symbol.If you confused on coding formula, please share some same data for test and coding formula.
Regards,
Xiaoxin Sheng
- AnonymousNot applicable
I could not find how to upload a file, so here is a small subset of data that allows for testing. And yes I agree my issue is with the DAX as well.
Continent Continent Symbol Market Market Symbol Country Country Symbol EMEA € NORDIC € NORWAY kr EMEA € NORDIC € SWEDEN kr EMEA € NORDIC € DENMARK kr EMEA € NORDIC € FINLAND € - AnonymousNot applicable
Well, I'm a doofus. The solution is to reverse the order of conditions ... simple and solved my problem!
Label 1 = IF ( ISFILTERED ( 'DimLocation'[Country] ), [country_m], IF ( ISFILTERED ( 'DimLocation'[Market] ), [market_m], IF ( ISFILTERED ( 'DimLocation'[Continent] ), [continent_m], " " ) ) )