Forum Discussion
Incorrect matrix total for YTD
I have a matrix for countries, cities and YTD, but the YTD for the total and subtotals for countries is wrong. Here are the tables and measure:
CityCost table
| Country | City | Cost | Date |
| UK | London | 1787 | 01/01/2023 |
| UK | London | 9 | 02/01/2023 |
| UK | London | 267 | 03/01/2023 |
| UK | Manchester | -199 | 01/01/2023 |
| UK | Manchester | -182 | 02/01/2023 |
| UK | Manchester | 1113 | 03/01/2023 |
| UK | Liverpool | 638 | 01/01/2023 |
| UK | Liverpool | 1824 | 02/01/2023 |
| UK | Liverpool | 1198 | 03/01/2023 |
| UK | Liverpool | 1606 | 04/01/2023 |
| Germany | Berlin | 1265 | 01/01/2023 |
| Germany | Berlin | 94 | 02/01/2023 |
| Germany | Munchen | 227 | 01/01/2023 |
| Germany | Munchen | 1199 | 02/01/2023 |
| Germany | Munchen | 633 | 03/01/2023 |
| France | Paris | 1926 | 01/01/2023 |
| France | Paris | 349 | 02/01/2023 |
| France | Paris | 987 | 03/01/2023 |
| France | Paris | 1178 | 04/01/2023 |
DayCost table
| Date | DayCost |
| 01/01/2023 | 994140 |
| 02/01/2023 | 1293186 |
| 03/01/2023 | 1438443 |
| 04/01/2023 | 1291846 |
- Anonymous3 years ago
Hi Anonymous ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a measure.
TOTAL_YTD = SUMX(VALUES('CityCost'[Country]),[YTD])(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- AnonymousNot applicable
Hi Anonymous ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a measure.
TOTAL_YTD = SUMX(VALUES('CityCost'[Country]),[YTD])(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.