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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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