Hello @Geffmburu,
Surely, this is doable via DAX. You can use a “Calculated Column” option or can write as a “Measure” as well. Firstly, I’ll be providing a formulas for both the options and then attaching the screenshot of the final result -
Option 1: Calculated Column
So in Table B, we already have a “Finished Quantity” column which we retrieved yesterday using Power Query. Now, in the same table I’ll be adding a column using “Calculated Column” option. Below is the formula provided for the reference -
Finished Quantity 2 =
LOOKUPVALUE( 'Table 1'[Finished Quantity] ,
'Table 1'[Order No.] , 'Table B'[Order.No.] )
Option 2: Rather than adding a “Calculated Column” into the data model, we can do this via “Measure” as well. Below is the formula provided for the reference -
Finished Quantity =
LOOKUPVALUE( 'Table 1'[Finished Quantity] ,
'Table 1'[Order No.] , SELECTEDVALUE( 'Table 2'[Order.No.] ) )
Now, attaching the screenshot of the final result wherein you’ll observe that both the results are identical and there’s absolutely no difference at all in the final results. But then you may witness “Grand Totals” are different using “Calculated Columns” and “Measures”.
So if you don’t want to “Summarize” the calculated column then just change the option as shown below into the screenshot -
And the “Total” will disappear but the same option is not available for “Measures”. Below is the screenshot provided of the result for the reference -
I’m also attaching the working of the PBIX file for the reference. So I guess we’ve explored all the options. i.e. using Power Query, Calculated Column and Measures.
Hoping you find this useful.
Thanks and Warm Regards,
Harsh
Power Query.pbix (57.2 KB)