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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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
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.