Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Date in Range for specific criteria

I've a data for pay period (Bi weekly every Satuday) and the amount. I would like to get the latest pay period in the Bar chart (with prior) on bi weekly basis (every Thursday) For an example, let'...
  • v-zhangti's avatar
    3 years ago

    Hi, Anonymous 

     

    You can try the following methods.

    Date = CALENDAR(DATE(2023,1,1),DATE(2023,3,31))

    Measure:

    Next Thursday = CALCULATE(MAX('Date'[Date]),FILTER(ALL('Date'),[Weekday]=4&&[Weeknum]=MAX('Date'[Weeknum])+1))

    Date Slicer = CALENDAR(DATE(2023,1,1),DATE(2023,3,31))
    Measure =
    IF ( SELECTEDVALUE ( 'Date Slicer'[Date] ) >= [Next Thursday]
            && SELECTEDVALUE ( 'Date Slicer'[Date] ) >= SELECTEDVALUE ( 'Table'[Pay Period] ),
        1,
        0
    )

    Result:

     

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

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