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
Anonymous
Not applicable

If condition

Hi All,

 

Please help me with below query:

image.pngimage.png

       Table1                              Table2

I need the result as mentioned in table-2. Please help me with the same

 

Regards,

Chandra

1 ACCEPTED SOLUTION

Hi @Anonymous ,

You may refer to below formula:

Result2 = var a=RELATED(Table1[Result1])
return IF(a="N.A",Table2[Customers],a)

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

Community Support Team _ Daniel He
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

4 REPLIES 4
Gordonlilj
Solution Sage
Solution Sage

Hi,

 

You could achieve this either by creating a custom column in power query

if [Result] = "N.A" then [Names] else [Result]

or creating a calculated column using dax

Column = SWITCH(Table[Result],"N.A",Table[Names],Table[Result)

 

Anonymous
Not applicable

Hi,

Hi,

 

Thanks for your response, I've shared the pbxi file for your reference about my need.

 

I Wish to expalin the same in below points

 

1. Table1 is a list of Unique Customers with Result1 which has N.A for some customers.

2. Table2, i created a calculated Column to get the results using RELATED Function, but in this case in Table2 Result2 Column, If the value in Table1 is N.A then the customer name should reflect ( Table2 Customer name should reflect in Result column). 

image.pnghttps://drive.google.com/file/d/1OMK75SKXtvEfschaQW1jKMaubIrI0dxE/view?usp=sharing

Regards,

 

Hi @Anonymous ,

You may refer to below formula:

Result2 = var a=RELATED(Table1[Result1])
return IF(a="N.A",Table2[Customers],a)

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi All,

 

Please help me with the query.

 

Also, please suggest me if this is possible with "Custom Coumn" option.?

 

Appreciate your help

 

REgards.

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.