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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
adoalan
Helper III
Helper III

Convert this SQL to Power BI

Hi all,

 

I need to convert this CASE When to Power BI DAX. 

 

CASE WHEN gad.nfp_declaredfore IS NULL OR gad.nfp_declaredfore = '' OR gad.nfp_declaredsur IS NULL OR gad.nfp_declaredsur = ''
OR gad.nfp_declaredhouse IS NULL OR gad.nfp_declaredhouse = '' or nfp_declaredpostcode is null or nfp_declaredpostcode = ''
or nfp_declaredfore like '%&%' or nfp_declaredsur like '%&%' then 'Y' ELSE 'N' END AS [Missing Info],

adoalan_0-1668593335516.png

 

Many thanks in advance

 

3 REPLIES 3
adoalan
Helper III
Helper III

adoalan_0-1668596164245.png

adoalan_1-1668596185287.png

 

Hi @JorgePinho.

 

This is really close and makes sense. However I get this error. How to go around that

 

Many thanks

ADO

 

 

JorgePinho
Solution Sage
Solution Sage

Hello @adoalan !

 

Try this:

Missing Info = IF(ISBLANK(gad.nfp_declaredfore) || gad.nfp_declaredfore = "" || ISBLANK(gad.nfp_declaredsur) || gad.nfp_declaredsur = "" || ISBLANK(gad.nfp_declaredhouse) || gad.nfp_declaredhouse = "" || ISBLANK(nfp_declaredpostcode) || nfp_declaredpostcode = "" ||    CONTAINSSTRING( nfp_declaredfore , "&" ) || CONTAINSSTRING( nfp_declaredsur , "&" ), "Y", "N")

Hello @JorgePinho, This is very close.

 

But I get this 

 

adoalan_0-1669203576626.png

Do you see anything wrong here: (fields are a bit changed because we are migration in a different environment and names are a bit changed

 

adoalan_1-1669203608456.png

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.