Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I'm would like to generate a concatenated string of selected members (keys) from a slicer as a measure text string.
The end-user pick a few companies (CompanyName) in a slicer and I want the measure to return a string of CompanyKeys of the selected companies.
I have tried this;
It works great, if the slicer show the surugat key "CompanyKey". But the user do not understand what the number 12344321 means... We need to use the CompanyName in the slicer.
And I have tried this;
Solved! Go to Solution.
Hi @elidman ,
Please try below steps:
1. below is my test table
Table:
2. create a measure with below dax formula
Measure =
VAR _str =
CONCATENATEX ( 'Table', [Company Name], "," )
VAR tmp =
CALCULATETABLE (
VALUES ( 'Table'[Company Key] ),
CONTAINSSTRING ( _str, 'Table'[Company Name] )
)
RETURN
IF (
ISFILTERED ( 'Table'[Company Name] ),
CONCATENATEX ( tmp, [Company Key], "
" )
)
3. add a sclicer with "Table[Company Name]", add a card visual with measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @elidman ,
Please try below steps:
1. below is my test table
Table:
2. create a measure with below dax formula
Measure =
VAR _str =
CONCATENATEX ( 'Table', [Company Name], "," )
VAR tmp =
CALCULATETABLE (
VALUES ( 'Table'[Company Key] ),
CONTAINSSTRING ( _str, 'Table'[Company Name] )
)
RETURN
IF (
ISFILTERED ( 'Table'[Company Name] ),
CONCATENATEX ( tmp, [Company Key], "
" )
)
3. add a sclicer with "Table[Company Name]", add a card visual with measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@elidman , not very clear, but if you have company name column too
VAR Company = IF(ISFILTERED(DimCompany[CompanyKey]) ,
"CompanyKey = " & CONCATENATEX(DimCompany, DimCompany[CompanyKey] & " - " & DimCompany[CompanyName] , " , ") & CR_LF , "")
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!