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
Sir_night
Helper I
Helper I

Calculated Column with IF and from different table

HI GUYS and GALS

 

is it poassable to add a column to a exsting table based on another table using a if statement

 

i.e 

 

Table one                                                                          

 

RefStatusblahblah blah
1A15
2A15
3R25

 

Table 2 

 

RefStataus Nostatusnotes
11Raisedblah blah blah 
12Dispatched blah blah blah 
13Diliveredblah blah blah 
21Raisedblah blah blah 
22Dispatched blah blah blah 
399Out of stockblah blah blah 

 

Combined table

 

i only want notes when theres a problem (status 99) other wise blank

 

RefStatusblahblah blahnotes
1G15 
2A15 
39925blah blah blah 
1 ACCEPTED SOLUTION

@Sir_night,

 

Simply try LOOKUPVALUE Function.

notes =
LOOKUPVALUE ( Table2[notes], Table2[Ref], Table1[Ref], Table2[Stataus No], 99 )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
prateekraina
Memorable Member
Memorable Member

Hi @Sir_night,

 

Yes, its very much possible. Make sure you related the two tables before writing DAX to create a new column using IF statement.

 

Prateek Raina

hi prateekraina 

 

do you have any examples dax ?

@Sir_night,

 

Simply try LOOKUPVALUE Function.

notes =
LOOKUPVALUE ( Table2[notes], Table2[Ref], Table1[Ref], Table2[Stataus No], 99 )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.