Forum Discussion
Lookup between two dates
- Anonymous2 years ago
Hi Edds01388 ,
Do you want this:
I will first show you the sample data:Then use DAX to create a new column:
Title Matched = CALCULATE( FIRSTNONBLANK('Period ends'[Title], 1), FILTER( ALL('Period ends'), 'Safety Tracker 2023'[Date] >= 'Period ends'[Pdatefrom] && 'Safety Tracker 2023'[Date] <= 'Period ends'[Pdateto] ) )The final result is shown below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Edds01388 ,
I apologize that I may not have understood which column you were hoping to compare. Is the 'tracker' [Date] column being compared to see if the date is between "Pdatefrom" and "Pdateto"? If so, please provide some additional data for the 'tracker' [Date] column.
Also I'm not sure what the "Period" column does in your screenshot?
Based on the needs you describe, I will give you a reference DAX with which to create a new column:
PTitle =
IF(
'Table'[Date] >= 'periods'[Pdatefrom] && 'Table'[Date] <= 'periods'[Pdateto],
TRUE(),
FALSE()
)
You can change this DAX to suit your own situation.
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.