The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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
User | Count |
---|---|
65 | |
62 | |
59 | |
53 | |
28 |
User | Count |
---|---|
181 | |
82 | |
67 | |
47 | |
44 |