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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
adoalan
Helper III
Helper III

Case when in Power BI

I have this SQL code and I need to convert this in a dax in Power BI 

Can I get some help:

adoalan_0-1668506909790.png

 

Thank you

 

2 ACCEPTED SOLUTIONS

@adoalan you're missing two brackets "))" after "...Street1])" and after "...PostalCode])"

View solution in original post

@adoalan 
You are missing the brackets :- 

Can you just try this :-

 

Valldata Fix = IF(nfp_giftaiddeclaration[cratedbyyominame] = "Valldata" && ISBLANK(nfp_giftaiddeclaration[House])
&& ISBLANK(nfp_giftaiddeclaration[Postcode]) && NOT(ISBLANK(RELATED(contact[Address 1: Street 1]))) && NOT(ISBLANK(RELATED(contact[Address 3: ZIP/Postal Code]))), "Y", "N")

 

 

View solution in original post

10 REPLIES 10
JorgePinho
Solution Sage
Solution Sage

Hello @adoalan !

 

Create a dax column using this:

 

Valldata Fix = IF( gad.createdbyname = "Valldata" && ISBLANK(gad.nfp_declaredhouse) &&  ISBLANK(gad.nfp_declaredpostcode) && NOT(ISBLANK(c.adress1_line1)) && NOT(ISBLANK(c.adress1_postalcode)), "Y", "N")

 

 

 

@JorgePinho this works half for me. So the c.address1_line1 is coming from a different table called contact and it is not popping up when search. Can you help here?

adoalan_0-1668508698682.png

 

Are the tables connected?

Yes, 

adoalan_0-1668510655034.png

 

Thank you 

 

Try to use RELATED function to bring that column value. https://learn.microsoft.com/en-us/dax/related-function-dax

Jorge, not sure how to do that. CAn you give me an exmple?

 

Hi @adoalan!
You have to create the calculated column like this :-

 

Valldata Fix = IF( gad.createdbyname = "Valldata" && ISBLANK(gad.nfp_declaredhouse) && ISBLANK(gad.nfp_declaredpostcode) && NOT(ISBLANK(c.adress1_line1)) && NOT(ISBLANK(RELATED(c.adress1_postalcode))), "Y", "N")

I got up to here but still an error

adoalan_1-1668512354278.png

 

 

@adoalan 
You are missing the brackets :- 

Can you just try this :-

 

Valldata Fix = IF(nfp_giftaiddeclaration[cratedbyyominame] = "Valldata" && ISBLANK(nfp_giftaiddeclaration[House])
&& ISBLANK(nfp_giftaiddeclaration[Postcode]) && NOT(ISBLANK(RELATED(contact[Address 1: Street 1]))) && NOT(ISBLANK(RELATED(contact[Address 3: ZIP/Postal Code]))), "Y", "N")

 

 

@adoalan you're missing two brackets "))" after "...Street1])" and after "...PostalCode])"

Helpful resources

Announcements
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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.