Forum Discussion
Compare Data within related dates
- 6 years ago
İ have solved my own problem with below calculated column formula.
Column2 = CALCULATE(VALUES(Table1[Currency]),FILTER ( Table1, Table1[Valid From] <= 'Table 2'[Date] && Table1[Valid To] > 'Table 2'[Date] && 'Table 2'[Name]=Table1[Name] ))<div> </div>
You will need to check IF the selected date is <= Valid to date and > Valid from date. If you provide a bit more info on table names of data model or sample file we can be more helpful, but that is the general idea.
selpaqm I have updated with a specific example for you to try:
Assuming that Table 2 has both the Name and Date as columns, you could simply add a Column to Table 2:
Column =
CALCULATE (
IF (
HASONEVALUE ( Table1[Currency] ),
VALUES ( Table1[Currency] )
),
FILTER (
Table1,
AND (
Table1[Valid From] <= Table2[Date],
Table1[Valid To] > Table2[Date]
)
)
)
AllisonKennedy I have checked the example that you are assuming however table1 has no column named as date. so can you please check my example on below link. regards,