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
AdelNawar
Regular Visitor

Set Default value of a visual affected by a slicer

I have a list of vendors, each with a list of materials,

When I select a certain vendor, then select a material, it's name will appear in the card.

Without selection, it displays the name of the first material in all list "alphabetical order".

What I want to do is: make the default value, before selection, a text like: Awaiting selection, or whatever.

Thanks in advance for your help.

AdelNawar_0-1709190424402.png

 

1 ACCEPTED SOLUTION

Hi, @AdelNawar 

 

Of course, the effect you want to achieve is very simple, please refer to the MEASURE below. the Material description is displayed only when both slicers are selected.

 

Data:

vyaningymsft_2-1709276260684.pngvyaningymsft_0-1709276229633.png

vyaningymsft_1-1709276250651.png

 

Measure:

CardVisual =
VAR _meterialDescription =
    SELECTEDVALUE ( Providers[Material description] )
VAR _default = "Awaiting selection, or whatever."
RETURN
    IF (
        ISFILTERED ( Providers[Material] ) && ISFILTERED ( Providers[Providers] ),
        _meterialDescription,
        _default
    )

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

9 REPLIES 9
v-yaningy-msft
Community Support
Community Support

Hi, @AdelNawar 

 

Based on your description, I have created some measures to achieve the effect you are looking for. Following picture shows the effect of the display.

 

vyaningymsft_0-1709259713035.png

Measure:

CardVisual =

VAR _meterial =

    SELECTEDVALUE ( Providers[Materials] )

VAR _default = "Awaiting selection, or whatever."

RETURN

    IF ( ISFILTERED ( Providers[Materials] ), _meterial, _default )


Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

 

 

Dear,

Thanks for your support.

Your solution seems to be working, but is missing one small detail:

 

I don't want the card to display the selected material code. (which is how your solution works).

 

I want it to display the material name from the data set in a column called (material description).

 

So my dataset contains 3 columns:

Vendor

Material (which is the material code we select after selecting the vendor)

Material description (which is the material name I want to be displayed upon selecting the vendor and the material description)

 

Can you edit your measure to match that?

Thanks and sorry for all time and effort

Hi, @AdelNawar 

 

Of course, the effect you want to achieve is very simple, please refer to the MEASURE below. the Material description is displayed only when both slicers are selected.

 

Data:

vyaningymsft_2-1709276260684.pngvyaningymsft_0-1709276229633.png

vyaningymsft_1-1709276250651.png

 

Measure:

CardVisual =
VAR _meterialDescription =
    SELECTEDVALUE ( Providers[Material description] )
VAR _default = "Awaiting selection, or whatever."
RETURN
    IF (
        ISFILTERED ( Providers[Material] ) && ISFILTERED ( Providers[Providers] ),
        _meterialDescription,
        _default
    )

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

That's just Amazing !
Exactly what I wanted. Thanks.

Thanks a lot.

I will be able to try it on Sunday Morning, but according to your screenshot, this is exactly what I want.

Hopefully I will be back on Sunday to thank you again and accept it as a solution (f)

nareshr89
Helper II
Helper II

Update your current measure or create a new measure then use that measure in your report.

Thanks a lot for your continuous help,

It works fine when nothing is selected, but once I select any vendor, it doesn't do the job of mentioning the material name:

Here I am not selecting any, "all", and it's working fine.

AdelNawar_0-1709198310208.png

Here: I started selecting:

AdelNawar_1-1709198326480.png

 

nareshr89
Helper II
Helper II

Try this

 

DP =
var DP_Ven = SELECTEDVALUE('Table'[Vendor])
var DP_Mat = SELECTEDVALUE('Table'[Matrial])
var result = CONCATENATE(DP_Ven,CONCATENATE("|",DP_Mat))
RETURN
IF(DP_Ven = BLANK() || DP_Ven = ALL('Table'[Vendor]) || DP_Mat = BLANK() || DP_Mat = ALL('Table'[Matrial]),"Awaiting Selection", result)

Thanks a lot for your help 🙂 I am still a beginner, can you please tell me what to do with that dax? Like make a new measure or what? Detailed steps will be much much appreciated.

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.