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

IF is blank show me value from column

Hello.
I prepared a below measure that allow me to hide text. If there is no filter selection there no name on the card, but when i select something inside a filter i will see a name. 

SubDealerNM_HIDE =
IF (
    ISFILTERED ('Accountflex Data'[Dealer ID and Name Filter]) || ISFILTERED('Accountflex Data'[SubDealer_ID_NM]),
    SELECTEDVALUE('Sub Dealer Name'[SubDealerName]),
    " "
)


in most cases i have this type of name structure ( this is a example )

 



5640 - Google ( main )
5410 - Google ( submain )
4781 - Google ( submain )

and this give me this result : Google

but if I have something like this:

5640 - Google ( main )
5410 - Google ( submain )
5460 - Microsoft ( submain )
4781 - Google ( submain )

and this give me result : Blank

How to modify my measure so that in the case of " Blank " it shows me the value from a specific column.

Regards Piotr.
1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @piotrgrendus87 ,

I created some data:

vyangliumsft_0-1668476954735.png

Here are the steps you can follow:

1. Create measure.

No filter selection there no name on the card

Measure =
IF(
    HASONEVALUE('Sub Dealer Name'[Dealer ID and Name Filter])&&HASONEVALUE('Sub Dealer Name'[SubDealer_ID_NM])
    ,MAX('Sub Dealer Name'[SubDealerName]),BLANK())

 In the case of " Blank " it shows me the value from a specific column

Measure2 =
IF(
    HASONEVALUE('Sub Dealer Name'[Dealer ID and Name Filter])&&HASONEVALUE('Sub Dealer Name'[SubDealer_ID_NM])
    ,MAX('Sub Dealer Name'[SubDealerName]),
    MAXX(FILTER(ALL('Sub Dealer Name'),'Sub Dealer Name'[Dealer ID and Name Filter]=5460&&'Sub Dealer Name'[SubDealer_ID_NM]="5460 - Microsoft"),[SubDealerName]))

2. Result:

vyangliumsft_1-1668476954740.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @piotrgrendus87 ,

I created some data:

vyangliumsft_0-1668476954735.png

Here are the steps you can follow:

1. Create measure.

No filter selection there no name on the card

Measure =
IF(
    HASONEVALUE('Sub Dealer Name'[Dealer ID and Name Filter])&&HASONEVALUE('Sub Dealer Name'[SubDealer_ID_NM])
    ,MAX('Sub Dealer Name'[SubDealerName]),BLANK())

 In the case of " Blank " it shows me the value from a specific column

Measure2 =
IF(
    HASONEVALUE('Sub Dealer Name'[Dealer ID and Name Filter])&&HASONEVALUE('Sub Dealer Name'[SubDealer_ID_NM])
    ,MAX('Sub Dealer Name'[SubDealerName]),
    MAXX(FILTER(ALL('Sub Dealer Name'),'Sub Dealer Name'[Dealer ID and Name Filter]=5460&&'Sub Dealer Name'[SubDealer_ID_NM]="5460 - Microsoft"),[SubDealerName]))

2. Result:

vyangliumsft_1-1668476954740.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

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