Forum Discussion
ReiKam
9 years agoNew Member
Search for a value using date ranges
I need to look up a value in one table based on date ranges. I have the following setup. Table Watches Date Employee Start Stop Department Table Watches is a table showin...
- Anonymous9 years ago
Hi ReiKam,
Just create a calculated column using the following formula in your Sales table.
Dep = CALCULATE(FIRSTNONBLANK(Watches[Department],Watches[Department]),FILTER(Watches,Watches[Start]<=Sales[Time]&&Watches[Stop]>=Sales[Time]&&Watches[Employee]=Sales[Employee]&&Watches[Date]=Sales[Date]))
Thanks,
Lydia Zhang
bwarner87
4 years agoAdvocate I
For others: I came across this thread thinking it would resolve but it didn't. It did eventually lead me to another thread with a different approach that work. FYI -> Solved: Return value based on matching value & Date differ... - Microsoft Power BI Community