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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
DIFF1
Helper II
Helper II

Calculated column. 3 different tables IF/ CASE statement

 

Hello, 

 

I am trying to create a calculated column between 3 different tables. All 3 tables are connected on a filed called 'ITEMID' field.

Does someone know how to write it correctly please?

 

IF 'Staging'[CODE]='ITEM_DIVERT'[CODE] AND 'Staging'[CODE]='KILLS_DISPOSITION'[CODE] THEN 'Match between 3 tables'
IF 'Staging'[CODE]='ITEM_DIVERT'[CODE] AND 'Staging'[CODE] != 'KILLS_DISPOSITION'[CODE] THEN 'Match between Staging & Item_Divert'
IF 'Staging'[CODE]!='ITEM_DIVERT'[CODE] AND 'Staging'[CODE] = 'KILLS_DISPOSITION'[CODE] THEN 'Match between Staging & Divert_Code'
IF 'Staging'[CODE]!='ITEM_DIVERT'[CODE] AND 'Staging'[CODE] != 'KILLS_DISPOSITION'[CODE] THEN 'No match'
END AS 'Comparison'



2 REPLIES 2
amitchandak
Super User
Super User

@DIFF1 , You have bring other column this table using one of the 4 ways. You can bring them in var of the column

 

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

 

The syntax of if in power bi Dax id 

 

If(<Condition>, <Then>, <else>)

 

You can use switch

Switch-Case statement of #PowerBI: https://www.youtube.com/watch?v=gelJWktlR80&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=56

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thank you.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Top Solution Authors