Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi guys,
I need to create a column (ColumnQuestion), that if the date on Table2 is the same Date as Table1 then use Table2 values(this is the first LOOKUPVALUE in the script.)
The lookupvalues work great. I need help creating the filter that compares both dates, IF these dates are the same, then bring the "NumberofDays" from Table2 into Table1. (Please see that the lookupvalue has to be done by itemid and date.)
Table 2 only has 1 date.
Table1 has previous dates and future dates.
If I need to use MIN or MAX function I don't know how to use it in this case, with the double lookupvalue and the filter.
ColumnQuestion =
IF (
FILTER ( 'Table1', 'Table2'[DateValue] = 'Table1'[DateValue] ),
LOOKUPVALUE (
'Table2'[NumberofDays],
'Table2'[ItemID], 'Table1'[ItemID],
'Table2'[DateValue], 'Table1'[DateValue]
),
IF (
'Table1'[Date Past or Future] = "Past",
'Table1'[HistoricNumberofDays],
LOOKUPVALUE (
Table3[NumberofDays],
Table3[ItemID], 'Table1'[ItemID],
Table3[Year], 'Table1'[Year],
Table3[Week], 'Table1'[Week]
)
)
)
Thank youuuu
Thank you! I ended up creating a new column for current date, and that worked!
@Anonymous , You can get value from another table in a new column like. Change logic as per need
new colum =
var _Tab2= maxx(filter('Table2', 'Table2'[ItemID] = 'Table1'[ItemID] && 'Table2'[DateValue] = 'Table1'[DateValue]), 'Table2'[NumberofDays])
var _Tab3=
maxx(filter('Table3', 'Table3'[ItemID] = 'Table1'[ItemID] && 'Table3'[year] = 'Table1'[Year] && 'Table3'[Week] = 'Table1'[Week ] ), 'Table2'[NumberofDays])
return
max(_Tab2,_Tab3)
refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8