Forum Discussion

domden's avatar
domden
New Member
4 years ago
Solved

Total SUM in Matrix wrong

Hello there! I hope you guys can help me. I have a problem with the total sum under my matrix in pbi.   I got 2 different ordernumbers. Order 1 has 4 order items; Order 2 has 1 item. In Order 1, ...
  • BITomS's avatar
    4 years ago

    Hi domden,

     

    To achieve this, you can use one measure that uses a variable to summarize the data. Help on variables here: https://docs.microsoft.com/en-us/dax/best-practices/dax-variables

     

    Measure = VAR _Tbl = SUMMARIZE('TableName',[OrderNumber],"Count",DISTINCTCOUNT([OrderItem]))

    RETURN

    sumx(_Tbl,[Count])

     

    The variable is doing the distinct count per category in a table and then the sumx is referencing the variable table to sum the distinct counts together. Hope this helps!