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
Thoprice022
New Member

Dax IF/AND Statement with Null condition

Hi all,

 

I have to create an IF/AND statement with a null condition 

 

My condition is as follows:

 

Quality = 

IF(NOT(ISBLANK([Version])) && ISBLANK([Date])),

"Yes",

"No")

 

The logic is if Version is null and Date is not null then it outputs "Yes", otherwise "No".

I'm not getting an output and think something is wrong with the coding.

I am fairly new to Power BI and DAX so any resources to study is greatly appreciated.

 

Thank you!

 

1 ACCEPTED SOLUTION

Hi, @Thoprice022 

 

You can try the following methods.

Quality = 
IF([Version]=BLANK()&&[Date]<>BLANK(),
"Yes",
"No")

vzhangti_0-1663135765623.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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
erothen
Frequent Visitor

Do you have any examples of input and output data?

 

Remark from https://docs.microsoft.com/en-us/dax/blank-function-dax

  • Some DAX functions treat blank cells somewhat differently from Microsoft Excel. Blanks and empty strings ("") are not always equivalent, but some operations may treat them as such.

Input

VersionDate
A9.12
A 
 9.10
B9.12
  

 

Output

VersionDateQuality
A9.12No
A Yes
 9.10No
B9.12No
  No

 

They are blank and not empty strings.

 

Please let me know if you need anymore clarity

Hi, @Thoprice022 

 

You can try the following methods.

Quality = 
IF([Version]=BLANK()&&[Date]<>BLANK(),
"Yes",
"No")

vzhangti_0-1663135765623.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

When recreating in my own PBI, I noticed your provided DAX statement has an extra parenthesis after ISBLANK([Date]), so you could try the fixed version below:

Quality = IF(NOT(ISBLANK([Version])) && ISBLANK([Date]), "Yes", "No")

 

If this doesn't fix things, can you let me know if there is an error (and if so, what does it say), or does the quality column just come up as blank? Also, what data type are you using for date?

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.