I am looking for a ways to implement in power query or by using DAX
I do have two tables
Table_1 is as shown below:
Date Simple ActualValue Result
15.07.2023 A Null Result from Table_2 considering date
15.07.2023 B 20 20
15.07.2023 C 30 30
15.07.2023 D 40 40
15.07.2023 E 20 20
15.07.2023 F 12 12
15.07.2023 G Null Result from Table_2 considering date
16.07.2023 A Null Result from Table_2 considering date
16.07.2023 B 35 35
16.07.2023 C 42 42
16.07.2023 D 53 55
16.07.2023 E 60 60
16.07.2023 F 17 17
16.07.2023 G Null Result from Table_2 considering date
Table_2:
Complex Field_1 Operator_1 Field2 Operator_2 Field_3 Formula()
A B + C Null Null B+C
G E * D / F E*D/F
Formula column in Table_2 is a dynamically merged column from Table_2 and
I am looking for ways to dynamically calculate result for the Formulas of Table_2 by looking up values from Table_1 considering the Dates
Please do provide some suggestions.
You can use
Expression.Evaluatefor this issue.Also in the code below, I did NOT include the
Formula()column in my source data, but rather generated the formula in situ showing only the result.Paste the code below into the Advanced Editor. Then, if necessary, change the Table Names in the two Source lines to reflect your actual Table names in your workbook.
Table_1

Table_2

Result

Edit to account for different dates for different values
and also results being added to Table_1
New Table_1

Revised M Code
Results
