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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

merge multiple dax measures

I'm trying to merge 3 measures into 1 single measure with a if-else clause. The individual measures display the selected category for 3 different variables and are defined like:

 

 

 

Selected Category 1 = 
var selectedcat1 = SELECTEDVALUE('Table'[Category 1]) 
    return "Category 1: "& IF(ISBLANK(selectedcat1), "All", selectedcat1)

 

 

 

 

I want 1 single measure which runs based on a if-else clause. For eg. if I select 'A' in category 1 and dont select anything in category-2 or category-3, it should display only 'Category 1:A' in the measure value.

 

Screenshot 2020-11-06 141243.png

 

The pbix file with data and measures is attached here: https://drive.google.com/file/d/1YmnTOG3NCUyO5bHuOZhBAMQm4Nw2BUwL/view?usp=sharing 

2 REPLIES 2
lbendlin
Super User
Super User

selected = 
var selectedcat1 = SELECTEDVALUE('Table'[Category 1]) 
var selectedcat2 = SELECTEDVALUE('Table'[Category 2]) 
var selectedcat3 = SELECTEDVALUE('Table'[Category 3]) 
return IF(ISBLANK(selectedcat1),BLANK(),"  Category 1: " & selectedcat1) & 
       IF(ISBLANK(selectedcat2),BLANK(),"  Category 2: " & selectedcat2) &
       IF(ISBLANK(selectedcat3),BLANK(),"  Category 3: " & selectedcat3) 

 

NOTE: When you select B, Y and Beta the results may look weird.  This is caused by all three of your categories coming from the same table (and influencing each other).  In your real world report you need to use separate tables for your slicers.

Anonymous
Not applicable

Thanks for the DAX formula, it's working as expected. I created 3 different tables for slicers as you suggested but I'm still getting a blank table when I select B,Y and Beta like previous scenario. Is there any way I can displacy a custom text (eg No data) using the same DAX formula when there's a blank table being returned.

 

Updated pbix: https://drive.google.com/file/d/1YmnTOG3NCUyO5bHuOZhBAMQm4Nw2BUwL/view?usp=sharing

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.