Forum Discussion
Multiply DirectQuery row value with imported table value (DAX)
- 4 years ago
Anonymous I would think the summarize doing its job, what would be the job of related function in a "normal" setting without direct query.
Summarize is doing something like what group by is doing in SQL. Its grouping/aggregating where are many product id (facttable) to the table where is only one productId towards the right weight of that productID.
Thats also why you didnt got the right totals before. You were using the max weight of the entire table instead of the right weight of the filter context.
Hi Anonymous,
I don't know for sure why. But maybe we can try another approach. Since you have a many to 1 relationship lets try step by step to be sure whats happening here.
We now using related function. The related function need to be used from the many side of the table:
Measure : sumx ( 'Facttable','Facttable' [unitssold] * related ( 'dimproduct'[weight])
I now would think you already have the right result for row and as total. Please let me know if it works out for you.
Best.
Applicable88 When I try RELATED (this only takes one column as input, correct?) it does find 'dim Product'[weight] as an option. But when I hit enter it tells me:
The column 'dim Product[weight]' either doesn't exist or doesn't have a relationship to any table available in the current context.
From my limited understanding I thought this is due to limitations on the RELATED function when using mixed storage model.