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
RodCamargoJr
Helper I
Helper I

Multiples selected values to display as one specific text

Hi friends,

I'm trying to get a text display in a card box, based on the filters that I'm choosing on the screen.

But my problem is: when I choose a specific filter under a macro filter, my DAX formula keeps me returning the macro and not the specific filter.

For instance: 

I would like to display "AMERICA" instead of "INTERNATIONAL", but the value "AMERICA" belongs to "INTERNATIONAL".

RodCamargoJr_0-1674661280928.png


My measure is currently:

DisplayText = "LOGISTICS OVERVIEW FEV - " &
IF(
    SELECTEDVALUE( COLUMN 1 ) = "INTERNATIONAL"
    ;
    "INTERNATIONAL"
    ;
    IF(
        SELECTEDVALUE( COLUMN 1 ) = "HALAL";
        "HALAL"
        ;
        SELECTEDVALUE(COLUMN 2)
    )
    )

 

The table structure is basically:

COLUMN 1 (MACRO)COLUMN 2 (MARKET)
INTERNATIONALAFRICA
INTERNATIONALEUROPE
INTERNATIONALEURASIA
INTERNATIONALASIA
INTERNATIONALAMERICA
HALALMIDDLE EAST


Does anyone know how to fix this?

Thanks!

1 ACCEPTED SOLUTION

Hi @v-shex-msft ,

I tried using the function ISFILTERED, even if the filters are on the same tables, and it did work here!
This is my code:

Cabeçalho =
"LOGISTICS OVERVIEW "
& "FEV"
& " - "
&
        IF(
            ISFILTERED(COLUMN 1);
            SELECTEDVALUE(COLUMN 1);
        SELECTEDVALUE(COLUMN 2))

View solution in original post

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

HI @RodCamargoJr,

Did these filter use the same table field as source? AFAIK, current power bi filters does not support to get different values from the filters that used same table feild as source .

If they are from different fields, you can use ISFILTERED function to trace the selections and as conditions to use in if statements.

ISFILTERED function (DAX) - DAX | Microsoft Learn

Notice: current power bi use 'AND' logic to link different filters, if you want to achieve some customize filter effects, please create unconnected tables(not has relationship to current table relationships) as source of filter.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft , thank you for your reply,

Yes, both filters "Macro Markets" and "Market" are in the same table,

COLUMN 1 (MACRO)COLUMN 2 (MARKET)
INTERNATIONALAFRICA
INTERNATIONALEUROPE
INTERNATIONALEURASIA
INTERNATIONALASIA
INTERNATIONALAMERICA
HALALMIDDLE EAST



Hi @v-shex-msft ,

I tried using the function ISFILTERED, even if the filters are on the same tables, and it did work here!
This is my code:

Cabeçalho =
"LOGISTICS OVERVIEW "
& "FEV"
& " - "
&
        IF(
            ISFILTERED(COLUMN 1);
            SELECTEDVALUE(COLUMN 1);
        SELECTEDVALUE(COLUMN 2))

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