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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Excel Power Query IF Statement

Hi,

 

I am trying to work on a formula, but it isnt working out.

The column Approved Date has data with Dates and some without Dates (blank)

I would like to put in a formula mentioning , if its blank then the column should return Not Approved

 

if [Approval Date] = null then "Not Approved" else "Approved"

Annotation 2020-09-08 111502.png

 

 

 

 

1 ACCEPTED SOLUTION

Hello @Anonymous 

 

there is definitly a null in your column if the cell is empty. So I checked it against "null" and it works perfectly fine

image.png

 

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

View solution in original post

11 REPLIES 11
Anonymous
Not applicable

Hi @amitchandak and @Jimmy801 

 

Tried both the methods, the below is the screenshot, I checked the cell, it has only date and the type is selected as date.

 

Capture2.PNG

Hello @Anonymous 

 

last two tries 🙂

if Text.Clean(Text.Trim([Approval Date])) = "" then "Not Approved" else "Approved"

 

if Value.Is([Approval Date],type datetime) = true then "Approved" else "Not approved"

 

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

Anonymous
Not applicable

@Jimmy801 Tried it not working

 

Anyway to send by email and give it a try

 

Capture3.PNG

Hello @Anonymous 

 

could you upload the file to some sharing site and share the link here, then I can check it

 

Jimmy

Anonymous
Not applicable

Hi @Jimmy801 

 

The file in the below link. I have given the column names with the ones we discussed here.

 

https://drive.google.com/file/d/1wydE7mu23l2VHmvXyIBn5MyWQoW7Thhu/view?usp=sharing

Hello @Anonymous 

 

there is definitly a null in your column if the cell is empty. So I checked it against "null" and it works perfectly fine

image.png

 

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

Anonymous
Not applicable

I just changed the "" and changed it to null and its working

Jimmy801
Community Champion
Community Champion

Hello @Anonymous 

 

the formula is perfectly fine. However I think your values are not containing null but "" instead

Try to change your formula to:

if [Approval Date] = "" then "Not Approved" else "Approved"

 

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

@Anonymous ,

 

Try like

if Text.Trim([Approval Date]) = "" then "Not Approved" else "Approved"

 

You can add or [Approval Date] = null

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @Jimmy801 , I tried that too even it then returned only Approved

Below picture :

 

Annotation 2020-09-08 114907-2.png

Hello @Anonymous 

 

check your cell content then. I don't know your database, but it could also be that your empty cell contains a space. Try this solution then

if [Approval Date] = " " then "Not Approved" else "Approved"

 

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors