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
StephenF
Responsive Resident
Responsive Resident

Dynamic values in text field - getting from drop down

Im getting values for a dynamic text field from a SLICER dropdown.

 

Im able to get  the text "ALL" and individual single item names but not a list when multiple items are selected - "All" is returned.

 

Is there a way to rewrite my function here from

 

Selected Media = SELECTEDVALUE('DataLake'[Media],"All Media")
 
In such as a way as this
 
if selected media is multiple items return a list else if a single item return that item only else return "all".
 
 
 
 
 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@StephenF , Based on what I got

 

if(isfiltered('DataLake'[Media]) , concatenatex('DataLake', 'DataLake'[Media], ", ") ,"All Media" )

View solution in original post

That sort of works but it outputs thousands of values. I need it to rollup the values. There is only 5 different distinct values in my dropdown.

 

I think it needs to work with DISTINCT but i can't get the syntax right, any idea?.

 
Edit: working code is :
 
Selected Media plus = if(isfiltered('DataLake'[Media]) , calculate(concatenatex(VALUES('DataLake'[Media]), 'DataLake'[Media], ", " ,"All Media" )))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@StephenF , Based on what I got

 

if(isfiltered('DataLake'[Media]) , concatenatex('DataLake', 'DataLake'[Media], ", ") ,"All Media" )

That sort of works but it outputs thousands of values. I need it to rollup the values. There is only 5 different distinct values in my dropdown.

 

I think it needs to work with DISTINCT but i can't get the syntax right, any idea?.

 
Edit: working code is :
 
Selected Media plus = if(isfiltered('DataLake'[Media]) , calculate(concatenatex(VALUES('DataLake'[Media]), 'DataLake'[Media], ", " ,"All Media" )))

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.