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

Custom Column If and If and If then

Hello I am looking to compare 9 different columns of which 2 will always match if they match a specific name then I want to return a value.  I was trying to do this in a custom column and was playing around with the "switch" command, but I don't think it does what I need. 

 

If the two "L Columns" match and they are both "Jeff 1234" then return a custom value.  Any help would be greatly appreciated. Thank you!

 

L1L2L3L4L5L6L7L8L9Layer
   Jeff 1234Jeff 1234    L5
 Jeff 1234Jeff 1234      L3
Jeff 1234Jeff 1234       

L2

  Jeff 1234Jeff 1234     L4
1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Maybe you can unpivot the table first and compare the values.
It is best to give a table of expected output.

v-lionel-msft_0-1613527936972.png

 

Best regards,
Lionel Chen

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
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Maybe you can unpivot the table first and compare the values.
It is best to give a table of expected output.

v-lionel-msft_0-1613527936972.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

PaulDBrown
Community Champion
Community Champion

@Anonymous 

Please read this thread to help us help you.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

Thank you Paul, I've read it before and tried to follow it. Always good to refresh though. I'll add my formula to follow the guidelines, though I don't think my formula is even close, maybe I'll get lucky.

 

If L2=L3 and if L3 = "Jeff 1234" then "L3" else ""   

 

Hopefully that helps.

@Anonymous 

What would really help is if you provided a sample dataset or PBIX file (change the column names to preserve confidentiality) so that we can work on the problem. A depiction of the expected result is also essential. 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.