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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Chidi2
Regular Visitor

IF formulas with different Data type column

Hello all: 

Please i need some help on how to if statement on Power BI 

 

I have this Table below.  I  am trying to create a new Column- (Date posted) that will compare "Date Completed" With Delivery.

 

 

I am trying to copy over Date Completed to the new Column-(Date Posted)  if there is a Date on Date Completed,  but if is blank,  Check if Complete date is blank and Delivery has any value, i will covert the to todays date using Now(),

if both Date Completed and Delivery  is blank then  the "Date Posted" should be blank. 

 

 

IF(AND(Date Complete =isblank(), Delivery (Value)), NOW(), 

    IF(Date Complete =Value, Date Complete, Blank()

 

 

 

Date Completed DeliveryPosted Date 
2/14/2018DL2292/14/2018
2/14/2018KD317R2/14/2018
2/15/20185DL290R2/15/2018
2/15/2018 2/15/2018
2/16/2018M2290_32/16/2018
   
 PD2C5Todays date (Now()
 CNL2290RTodays date (Now())
2/16/2018 2/16/2018
   
2/16/2018 2/16/2018
1 ACCEPTED SOLUTION

@BalaVenuGopal

 

i try using AND on the Formula it work. 

 

Posted Date = if(and(ISBLANK(Sheet1[Date Completed ].[Date]),ISBLANK(Sheet1[Delivery])),BLANK(),if(ISBLANK(Sheet1[Date Completed ].[Date]),today(),Sheet1[Date Completed ].[Date]))

View solution in original post

4 REPLIES 4
BalaVenuGopal
Resolver I
Resolver I

Hi @Chidi2 ,

 

Once your data is loaded on left hand panel you will have 3 icons

1) Report icon

2)Table icon

3)Relationship icon

 

just you click table icon and select your table from right panel -->go to Modeling tab on top --> Add column then use bellwo formula for new column.

 

Date posted = IF(ISBLANK(DateCompleted),TODAY(),DateCompleted)

 

If this works for you please make this is solution.

 

Thanks

Thanks for the formular BalaVenuGopal, i have tried that fomular it did not work.  i wil like to keep Posted Date Blank When both Delivery Date Completed is Blank.  

 

Desired output,-- Posted date should be blank when Date Completed and Delivery are blank. 

                             Posted Date should be today() when Date Completed is blank()

                             Posted Date should be Date Completed when Date completed is not Blank()

Date Completed DeliveryPosted Date 
2/14/2018DL2292/14/2018
2/14/2018KD317R2/14/2018
2/15/20185DL290R2/15/2018
2/15/2018 2/15/2018
2/16/2018M2290_32/16/2018
   
 PD2C5Todays date (Now()
 CNL2290RTodays date (Now())
2/16/2018 2/16/2018
   
2/16/2018 2/16/2018

 

 

your Formular--Date posted = IF(ISBLANK(DateCompleted),TODAY(),DateCompleted) Gives me this: 

Date Completed DeliveryPosted Date 
2/14/2018DL2292/14/2018
2/14/2018KD317R2/14/2018
2/15/20185DL290R2/15/2018
2/15/2018 2/15/2018
2/16/2018M2290_32/16/2018
   Todays date (Now()
 PD2C5Todays date (Now()
 CNL2290RTodays date (Now())
2/16/2018 2/16/2018
   Todays date (Now()
2/16/2018 2/16/2018

@BalaVenuGopal

 

i try using AND on the Formula it work. 

 

Posted Date = if(and(ISBLANK(Sheet1[Date Completed ].[Date]),ISBLANK(Sheet1[Delivery])),BLANK(),if(ISBLANK(Sheet1[Date Completed ].[Date]),today(),Sheet1[Date Completed ].[Date]))

@Chidi2,

 

By the way, you may help accept solution. Your contribution is highly appreciated.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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