Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Error * If statement for date

Hi, 

I would like to create If Statement in my 2 Date Columns. 

It works well in excel, but in Power Bi, it gives me the error warning. 

What should I change to make it work?

Hope to hear from you. 

Thanks

  • I believe that PBI is seeing "" as a string, even though it is empty. Try using:

    IF(ISBLANK('Table'[Field]), "if true", "if false")

     

4 Replies

  • I believe that PBI is seeing "" as a string, even though it is empty. Try using:

    IF(ISBLANK('Table'[Field]), "if true", "if false")

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      I will try and let you know later!!

      Thanks for quick reply :) 

  • v-lili6-msft's avatar
    v-lili6-msft
    Community Support

    hi, Anonymous 

    In power bi, just try this formula

     

    IF(Deals[Deal·Deal closed on].[Date]=BLANK(),"Open",IF(Deals[Deal·Won time].[Date]=BLANK(),"Lost","Won"))

    or

     IF(ISBLANK(Deals[Deal·Deal closed on].[Date]),"Open",IF(ISBLANK(Deals[Deal·Won time].[Date]),"Lost","Won"))

    Best Regards,

    Lin

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      v-lili6-msft I will try and let you know later :) 

      Thanks for reply