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