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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

DAX measure for combining text based on Slicers

Hi everybody, 

 

I'm looking for help regarding DAX measure for combinevalues or concatenate text, based on slicer.

 

I wrote this measure that works well, for one of the criterias, but for others not really. 

 

Measure = IF(ISFILTERED(tst[Race]), COMBINEVALUES(" ", "There are", SUM(tst[num]), SELECTEDVALUE(tst[Race]), SELECTEDVALUE(tst[Profession])), SUM(tst[num]))

 

In the first picture, it works fine, as I have selected just a race. As soon as I selected to races, it doesnt display the races of the profession (2nd photo). I would like it to show, there are 5 caucasian and asian teacher. Any idea guys why my measure is not working properly? I truly appreciate your help. 

 

1.PNG2.PNG

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi edoyak,

 

Modify your DAX formula like this:

 

Measure = IF(ISFILTERED(tst[Race]), COMBINEVALUES(" ", "There are", SUM(tst[num]), CONCATENATEX(tst, CALCULATE(MIN(tst[Race]), ALLSELECTED(tst[Race])), " and "), SELECTEDVALUE(tst[Profession])), SUM(tst[num]))

 

Capture.PNG

   

PBIX here: https://www.dropbox.com/s/djzm6i4jcjk19uh/DAX%20measure%20for%20combining%20text%20based%20on%20Slic...

 

Regards,

Jimmy Tao

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi edoyak,

 

Modify your DAX formula like this:

 

Measure = IF(ISFILTERED(tst[Race]), COMBINEVALUES(" ", "There are", SUM(tst[num]), CONCATENATEX(tst, CALCULATE(MIN(tst[Race]), ALLSELECTED(tst[Race])), " and "), SELECTEDVALUE(tst[Profession])), SUM(tst[num]))

 

Capture.PNG

   

PBIX here: https://www.dropbox.com/s/djzm6i4jcjk19uh/DAX%20measure%20for%20combining%20text%20based%20on%20Slic...

 

Regards,

Jimmy Tao

Anonymous
Not applicable

I tried your solution and it works. thank you. But before this, I used Variables and it worked perfectly well for my situation because I had a lot more slicers and nested if's would've been a pain in the a**. Thanks a lot. I would refer to this solution in the future.  

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors