Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Calculate the sum of values from three different visuals

I have three visuals which are each created from a different table. I need to add the totals from the rows in the visual together. I have not been able to accomplih this. I tried to combine the columns from the differnt tables into one visual but I'm unable to apply the correct filters to get an accurate sum of the column rows. Does anyone have a suggestion as to how to accomplish this.  I added a crude example of my visuals that I'm trying add together. I need to get the total of the three into one measure or visual so that I can display the total = 16. 

 

Visual1              Visual2               Visual3

1                          2                       1

2                          2                       1

3                          3                       1

Total 6                Total 7             Total 3

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

     

    Modify above formula like below:

    TotalVisual1 = CALCULATE(SUM(Table1[Value1]))
    TotalVisual2 = CALCULATE(SUM(Table2[Value2]))
    TotalVisual3 = CALCULATE(SUM(Table3[Value3]))

    Best Regards,
    Adamk Kong

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

5 Replies

  • you want to combine the three visuals to one? or only total to 16?

    could you pls provide some sample data and explain more about this

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    You can try formula like below:

    TotalVisual1 = SUM(Table1[Value1])
    
    TotalVisual2 = SUM(Table2[Value2])
    TotalVisual3 = SUM(Table3[Value3])
    TotalAllVisuals = [TotalVisual1] + [TotalVisual2] + [TotalVisual3]

    Best Regards,
    Adamk Kong

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Adam, I have tried your suggestion but the data from each table needs to be filtered in order to give me the correct result. I have not been able to successfully build three measures that apply the needed filters. I've tried to use the caculate function but it does accept filters based on columns from different tables. Is there another DAX function that might allow me to filter the data?

      • Transform121's avatar
        Transform121
        Helper I

        If you have unique table filters on individual visualisations then you need to re-write your measures and use either CALCULATE(SUM()) or SUMX(FILTER(),) to include the conditional filters into the measures.

         

        Right now your filters are external and apply at the visual level. If you include them into the measures by re-writing your formulas you can then do a formula like this:

        Combined Measure = [measure1] + [measure2] + [measure3]