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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Using DAX SWITCH by joining 2 tables.

Below is my requirement in sql. can anyone please give that equivalent SWITCH IN DAX. Both Tables in Powerbi are having a join relationship
in the model already.

CASE WHEN TableA.customertype = 'New' AND TableB.flag = 'NO' THEN 'New Customer'
,WHEN TableA.customertype = 'Existing' AND TableB.flag = 'NO' THEN 'Existing Customer'
,WHEN TableB.flag = 'Yes' THEN 'Employee'

Many Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I have resolved this using RELATIVETABLE function in DAX.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

I have resolved this using RELATIVETABLE function in DAX.

Anonymous
Not applicable

Hi Denis, the Condtional column which you suggeseted only allows me to add conditions based on the current table but not from other tables.  Basically i need to write SWITCH statement joining another table. Can you please help me on that ? Thanks

Anonymous
Not applicable


Hi Denis, thanks for this. but can you please provide me with that DAX SWITCH statement for creating that condtional column ?

Many Thanks

selimovd
Super User
Super User

Hello @Anonymous ,

 

join the tables in Power Query and then add a conditional column:

2.png

 

In the upcoming dialogue you can do the required statements.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.