Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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" )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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" )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.