Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Help with DAX Formula

Hi,

 

I have to add custom column called "last week" with the following expression : 

(departure_ >= date_add(current_date(), -$Weeks (4)*7) and departure<current_date())

 

Can someone please help me with dax expression.

Thanks in advance.

  • Hi, Anonymous 

     

    Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

    Table:

     

    You may create a measure as below.

     

     

    Visual Control = 
    IF(
        MAX('Table'[Departure])>=TODAY()-28&&
        MAX('Table'[Departure])<TODAY(),
        1,0
    )

     

     

     

    Then you may put the measure in the visual level filter to filter the result.

     

    Best Regards

    Allan

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies