Forum Discussion
heatherkw
Helper I
3 years agoDynamic Text Using List Separated by Commas and or Before Last Value
Hello, A long timeago I found something that provided the solution I'm looking for, but I can't seem to find it again. I have a slicer for program type and users can select 1-5 values. I am usin...
- 3 years ago
Thanks! This helped lead me down the right path. I still had to do some tweaking, but this works for me based on how it's set up in my dashboard.
ProjectSelection_Exits = VAR SelectedProj = VALUES(ExitsPH_HUD[RecodePgmType]) VAR NumberOfSelectedProj = COUNTROWS (SelectedProj) VAR AllButLastProj = TOPN(NumberOfSelectedProj - 1, SelectedProj) VAR LastSelectedProj = EXCEPT(SelectedProj, AllButLastProj) RETURN IF(NumberOfSelectedProj = 3 || NumberOfSelectedProj = 4, CONCATENATEX(AllButLastProj, ExitsPH_HUD[RecodePgmType], ", ") & ", or " & LastSelectedProj, IF(NumberOfSelectedProj = 2, CONCATENATEX(AllButLastProj, ExitsPH_HUD[RecodePgmType], ", ") & " or " & LastSelectedProj, IF(NumberOfSelectedProj = 1, LastSelectedProj, "all service types")))
Sergii24
Super User
3 years agoHi heatherkw, here is the way to create a measure that dynamically contains multiple selected string values:
Dynamic Title Measure = CONCATENATEX( Projects, Projects[Project Title], "," )
Original solution has been proposed by Matt Allington in this community post.