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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lokeshb31
Helper II
Helper II

Calculate Legend from from two different columns

We are developing HR dashboard and have 2 columns in table "Promotion" and "Promotion to Leadership". Since this is promotion table, value for Promotion = Yes in all rows but "Promotion to Leadership" = Yes or No. I want to combine them for legend so that Legend will show values as Promotions and Promotions to Leadership separately in line chart. 

 

lokeshb31_0-1615381311930.png   

lokeshb31_1-1615381395728.png

Please help with DAX. 

 

1 ACCEPTED SOLUTION

Thanks for reply Amit.

 

That looks like another way but I found if clause syntax and tried it - 

If(And(Promotion[PROMOTION]="Yes",Promotion[PROMOTION_TO_LEADERSHIP]="Yes"),"Promotion To Leadership","Promotion") 
It worked.  Thanks for your quick help though. 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@lokeshb31 , You need to have a table (say flag) with values yes and no, Join both columns with this. One join will be inactive. That you can activate using userelationship

 

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

Thanks for reply Amit.

 

That looks like another way but I found if clause syntax and tried it - 

If(And(Promotion[PROMOTION]="Yes",Promotion[PROMOTION_TO_LEADERSHIP]="Yes"),"Promotion To Leadership","Promotion") 
It worked.  Thanks for your quick help though. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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