Forum Discussion

JustDavid's avatar
JustDavid
Icon for Helper V rankHelper V
1 year ago
Solved

SUM with RELATED

In this sample table, I have factTable and uniqueTable.

 

Given the matrix view from factTable, I'm trying to get the value from uniqueTable.

 

However, given my current DAX, it's giving me wrong value, and I suspect it's summing the value from the uniqueTable Nth times that appears in the factTable

 

SUMX(factTable, RELATED(uniqueTable[Total]))

 

Sample PBIX File 

  • JustDavid it should be something like this:

     

    Sum = 
    SUMX ( 
        SUMMARIZE ( 'Fact', 'Fact'[Region], 'Fact'[ID], 'Unique'[Total] ),
        [Total]
    )

     

    The other solution with MAXX will not work for the row total. 

5 Replies

  • JustDavid it should be something like this:

     

    Sum = 
    SUMX ( 
        SUMMARIZE ( 'Fact', 'Fact'[Region], 'Fact'[ID], 'Unique'[Total] ),
        [Total]
    )

     

    The other solution with MAXX will not work for the row total. 

  • JustDavid 

    it's not a good way of creating data modeling. your fact table is like a dim table but doesn't have the primary key column. What's more you don't have Q3FY25 B in your fact table. 

    what's more, I can't open the link you provided. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi JustDavid,

     

    Thanks ryan_mayu  and parry2k for Addressing the issue.

     

    we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
    If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

     

    Regards,
    Vinay Pabbu

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi @JustDavid,

       

      we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
      If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

       

      Regards,
      Vinay Pabbu

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi @JustDavid,

         

        we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
        If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

         

        Regards,
        Vinay Pabbu