Forum Discussion

Rate's avatar
Rate
Helper III
7 years ago
Solved

Help SUM by Two columns: Origin and Destination

Hello there!   I am having some trouble with something that I believe should be more o less easy, but my DAX is still very basic, so I would love if you could help me!   Among other tables, I hav...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Hello Rate,

     

    might not be the most elegant solution but have a look at this:

     

    I made two tables with SUMMARIZE in order to group the quantity by origin and destination:

     

    Origin = SUMMARIZE(movimientos_supervisores_azafat,movimientos_supervisores_azafat[Origin],"Origin Quantity",SUM(movimientos_supervisores_azafat[Quantity]))
    Recepients = SUMMARIZE(movimientos_supervisores_azafat,movimientos_supervisores_azafat[Destination],"Rec Quantity",SUM(movimientos_supervisores_azafat[Quantity]))

    Then I connected the these two tables with your User table via User and Origin/Destination

    Finally I made this measure with the substraction:

    Quantity by User = SUM(Recepients[Rec Quantity])-SUM(Origin[Origin Quantity])

    please let me know if it helped you.

     

    Regards,

    Barna