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.
Applicable88 Thanks, that definitely helps me to understand and points me in a clearer direction.
I've tried just now (with two separate measures), I am getting a very strange error if I bring the final measure in a visual:
OLE DB or ODBC error: Query (8, 2) The column 'PC Group (groups)' specified in the 'SUMMARIZE' function was not found in the input table..
The strange part is that the measure does not contain SUMMARIZE, moreover PC Group is a completely separate dimension (part of the DirectQuery dataset, with only a relationship to the fact table). I understand this seems to go beyond the initial question, but any thoughts on why a measure containing SUMX can generate the above error in a visual?
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.
- Anonymous4 years agoNot applicable
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.