Forum Discussion

WGO's avatar
WGO
New Member
2 years ago
Solved

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...
  • ray_codex's avatar
    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