Forum Discussion

kodnil2020's avatar
kodnil2020
Helper I
6 years ago
Solved

DAX formation for date

Hello,   Need help on forming DAX for finding employees with start date is less than or equal to 31 Jan of current month.   'Employee Details'[StartDate] <= 01/31/{Year(today()}  
  • amitchandak's avatar
    6 years ago

    kodnil2020 ,

    Try in a new column

     

    'Employee Details'[StartDate] <=date(year(today()),1,31) 
  • v-alq-msft's avatar
    6 years ago

    Hi, kodnil2020 

     

    Based on your description, I assume that you want to filter out employees whose start date is less than or equal to31 Jan of current year. I created data to reproduce your scenario. The pbix file is attached in the end.

     

    Employee Details:

     

    You may create a measure as below.

    Visual Control = 
    IF(
       SELECTEDVALUE('Employee Details'[Start Date])<=DATE(YEAR(TODAY()),1,31),
       1,0
    )

     

    Then you need to put the measure in the visual level filter to get 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.