Forum Discussion

Bbrown44's avatar
Bbrown44
Advocate II
8 years ago
Solved

How to calculate a yes/no (binary) variable from date variable

I have a date variable where I want to create a new variable where IF date IS NOT Null THAN "YES' ELSE IF "NO"  

 

I tried to use DAX create this variable by creating a new column this is what I have

 

Criteria = IF('Base Population Summary'[Date (11/17)].[Date]null,"NO","YES")

 

Base Population Summary = Data Tab

Date (11/17) = Date Variable

 

What is the correct way to write this custom variable?

 

Thanks

~Bryon

  • Bbrown44's avatar
    Bbrown44
    8 years ago

    This worked with just a tweak:  Thanks!!!

     

    IF('Base Population Summary'[Date (11/17)].[Date]=BLANK(),"Yes","No")

  • Anonymous's avatar
    Anonymous
    8 years ago

    NO problem, can you please mark it as resolved.?

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Can you try this?

     

    if (Base Population Summary'[Date (11/17)].[Date]=BLANK(),''Yes","No")

     

    Thanks

    Aditya

     

     

     

    • Bbrown44's avatar
      Bbrown44
      Advocate II

      This worked with just a tweak:  Thanks!!!

       

      IF('Base Population Summary'[Date (11/17)].[Date]=BLANK(),"Yes","No")

      • Anonymous's avatar
        Anonymous
        Not applicable

        NO problem, can you please mark it as resolved.?