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
Anonymous
Not applicable

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. 

 

Capture.PNG

 

1 ACCEPTED SOLUTION
Anonymous
Not 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], " " )
    )
)

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not 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], " " )
    )
)
Anonymous
Not 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. 

 

ContinentContinent SymbolMarketMarket SymbolCountryCountry Symbol
EMEANORDICNORWAYkr
EMEANORDICSWEDENkr
EMEANORDICDENMARKkr
EMEANORDICFINLAND

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.

Top Solution Authors