Forum Discussion

johndolan2's avatar
johndolan2
Resolver I
5 years ago
Solved

Totals incorrect

Hi. Here is what I have. 2 tables. Table 1 includes cities and charges. Table 2 includes cities.  In the example below if I select Memphis in table 1, table 2 should show Memphis and all the cities that are associated with Memphis. It does that. But instead of showing a total charge of 100, table 2 only shows a total charge of 50. 

 

I have been fumbling around with this. Any help would be greatly appreciated.

 

TABLE 1

CITYCHARGE
MEMPHIS50
BOSTON50
SAN JOSE50
POTSDAM50
TOTAL200

 

TABLE 2

CITYCHARGE
MEMPHIS50
POSTSDAM50
TOTAL50

 

Thanks - John

  • johndolan2's avatar
    johndolan2
    5 years ago

    I figured it out. Here is what I ended up doing. I deleted what i had done. Then duplicated Table 1 and named as Table 2. Creating the Sum measure in Table 2 fixed it. So now if someone selects an individual city in Table 1, Table 2 will be filtered to show the Table 1 city as well as the associated cities and the totals add correctly. I am sorry for the bother ... I should have had no problem with this ....Thanks again. John

4 Replies

  • MattAllington's avatar
    MattAllington
    Community Champion

    You have not provided enough information for anyone to help you.  You need to post details of the relationships between tables and clarity on which tables the columns in your visuals come from. 

    • johndolan2's avatar
      johndolan2
      Resolver I

      I figured it out. Here is what I ended up doing. I deleted what i had done. Then duplicated Table 1 and named as Table 2. Creating the Sum measure in Table 2 fixed it. So now if someone selects an individual city in Table 1, Table 2 will be filtered to show the Table 1 city as well as the associated cities and the totals add correctly. I am sorry for the bother ... I should have had no problem with this ....Thanks again. John

      • MattAllington's avatar
        MattAllington
        Community Champion

        If it does what you want, then we'll and good, but I suspect the approach is not optimal. Your 2 tables look the same to me, so I wonder why you have 2 tables and wonder if you would be better appending them together in power Query into a single table.  When you get the table structure right, everything else becomes easier

    • johndolan2's avatar
      johndolan2
      Resolver I

      Thanks Matt.

      Table 1 and Table 2 are in a many to many relationship.  They are related by circuit numbers.

      Table 1 I have used Sum as a measure to sum the charges.

      Table 1 is in a matrix visual which shows cities and charges and the sum measure.

      Table 2 is in a matrix visual which shows cities. I am using the measure created for Table 1 in Table 2.

      My objective in doing this is to be able to make a single selction in Table one (such as Memphis) and Table 1 will show only Memphis and the single 50 charge for Memphis. Table 2 would show any city that is related to Memphis and the individual charges for those cities as well as the overall total of the individual city charges.

      John