Forum Discussion
WGO
2 years agoNew Member
Always use sum on different granularity
Hello, I was wondering if anyone could help with following model/dax problem: Simplified, we are getting invoice data from 2 different sources, but the problem is that the granularity from th...
- 2 years ago
I would try this way:
VAR tbl = SUMMARIZE ( [yourTable], [yourTable].[InvoiceNumber], [yourTable].[InvoiceLineNumber], "_quantity", AVERAGE ( [yourTable].[Quantity] ) ) VAR result = SUMX ( tbl, [_quantity] ) RETURN result
ray_codex
Resolver II
2 years agoI would try this way:
VAR tbl =
SUMMARIZE (
[yourTable],
[yourTable].[InvoiceNumber],
[yourTable].[InvoiceLineNumber],
"_quantity", AVERAGE ( [yourTable].[Quantity] )
)
VAR result =
SUMX ( tbl, [_quantity] )
RETURN
result
WGO
2 years agoNew Member
We will need to do some more testing (especially to make sure it doesn't have a big performance impact), but so far this does exactly what we want to achieve!
Thank you and also AlexisOlson for your help/advice with this.