Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Date Counter Column

Hello All,

 

I am looking to create 1 column that counts each date that is older than today's date.

 

This Counter Column will be feeding from 4 other columns. Each column contain a specific date (Future/Past dates).

 

Please take a look into the below screenshot to help you understand better:

 

Example.1

 Counter Column = 2

 

 Counter Column = 2

 

 

Counter Column = 4

 

 

any help is appreciated :))

 

Thank you,

Mo

  • Hi Anonymous ,

     

    How about this one:

     

    Here the code for the calculated column:

    Column = 
    ( Table[Date1] < TODAY() ) + ( Table[Date2] < TODAY() ) + ( Table[Date3] < TODAY() ) + ( Table[Date4] < TODAY() )

    Quite interesting, DAX considers TRUEs as 1 and FALSE as 0. That comes in handy in many cases, such as yours 🙂

     

    Let me know if this helps!

     

    /Tom
    https://www.tackytech.blog/
    https://www.instagram.com/tackytechtom/

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you tackytechtom  - this PBI feature came in handy 🙂 

  • tackytechtom's avatar
    tackytechtom
    Most Valuable Professional

    Hi Anonymous ,

     

    How about this one:

     

    Here the code for the calculated column:

    Column = 
    ( Table[Date1] < TODAY() ) + ( Table[Date2] < TODAY() ) + ( Table[Date3] < TODAY() ) + ( Table[Date4] < TODAY() )

    Quite interesting, DAX considers TRUEs as 1 and FALSE as 0. That comes in handy in many cases, such as yours 🙂

     

    Let me know if this helps!

     

    /Tom
    https://www.tackytech.blog/
    https://www.instagram.com/tackytechtom/