Forum Discussion
EaglesTony
1 year agoPost Prodigy
How do I get a value from another table based on a date range
Hi, I have a table with multiple Date Ranges (table called "DateRanges"): Column1 Cycle CycleStartDate CycleEndDate 2 1 3/31/2022 4/13/2022 2 ...
- 1 year ago
Hello EaglesTony ,
Simple use Lookup between FinalTable and ReportTable to get the value :
Cycle =LOOKUPVALUE(FinalTable [Cycle], -- Column to returnFinalTable [Key], ReportTable [Key] -- Matching Key from both tables)I have checked this with sample data :I hope this is what you are looking for .
Did I solve your Query ? Please mark this as solution. Appreciate Kudos always
Cheers
divyed
1 year agoSuper User
Hello EaglesTony ,
If you want column added in second table, here is the code :
Cycle1 =
CALCULATE(
MAX(T_1[Cycle]), -- You can use SUM, MIN, etc. as needed
FILTER(
T_1,
T_1[StartDate] <= T_2[Date] && T_1[EndDate] >= T_2[Date]
)
)
Please mark this as solution if this has solved your problem.
EaglesTony
1 year agoPost Prodigy
I'm able to get the correct cycle on this table.(call it FinalTable)
My issue now is there is a 3rd table (ReportTable), which I need to get this field into, but the issue is that the 3rd table has Keys that some don't match the FinalTable.