cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sagarsahoo_123
Helper III
Helper III

Display multiple values with selectedvalue

Hi Team,

Request for your support to resolve the displaying issue with selected value. I have written the code for this. But for non-selection, it is not displaying message which i want.

 

Here my requirement is i want to display the elements based on Slicer selection.

If i am selecting one value from slicer, it will show the same, but for more than one selection, it will display "Multiple Selection" .

Upto this my code is working but i want to display "All" for no selection in slicer. It is not displaying "All".

 

Please find the code which i have written below.

L4Name = "L4_DESC: " & FORMAT(SELECTEDVALUE(VW_NIPPON_PRODUCTIVITY[L4_DESC],"Multiple Selection"),"All")
 
I have used the L4_Desc in slicer, and it is coming fine upto single and more than one selection. But for non-selection, i am expecting to display "All" . It is not working for that. 
Please support in this regard.
 
sagarsahoo_123_0-1669438176196.png

If you look at the above image, here in the L4_Desc slicer there is no selection, but in the L4_DESC card below , it is showing " Multiple Selection" but i was expaecting "All" in that. But if i select more than one in the L4_Desc slicer, the message is coming correctly like "Multiple Selection"...

 

Please help to resolve this.

 

Regards,

Sagar

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @sagarsahoo_123 ,

you have to incorporate the DAX function ISFILTERED in your DAX statement: ISFILTERED – DAX Guide

Then your measure will look like this:

Measure = 
IF( ISFILTERED( 'DimStore'[StoreName] )
    , SELECTEDVALUE( 'DimStore'[StoreName] , "Multiple Selection" ) 
    , "All"
)

The result - the bottom right card visual is the important one:
image.png

The top right card only contains a simple measure for illustrative purposes.

 

Hopefully, this provides an idea of how to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey @sagarsahoo_123 ,

you have to incorporate the DAX function ISFILTERED in your DAX statement: ISFILTERED – DAX Guide

Then your measure will look like this:

Measure = 
IF( ISFILTERED( 'DimStore'[StoreName] )
    , SELECTEDVALUE( 'DimStore'[StoreName] , "Multiple Selection" ) 
    , "All"
)

The result - the bottom right card visual is the important one:
image.png

The top right card only contains a simple measure for illustrative purposes.

 

Hopefully, this provides an idea of how to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hi @TomMartens ,

Thanks a lot for your quick support. It realy helped to resolve the issue.

 

Regards,

Sagar

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Dev Camp Session 30

Ted's Dev Camp - January 26, 2023

This session will provide guidance and teach campers the skills required to build Power BI reports that support multiple languages.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.