Forum Discussion
Creating matrix from two tables and a calculation
- 3 years ago
There is only one row in 'Locations Coordinates' for an associated TotalCost even as your filter context may have multiple rows from 'JIRA'.
To force PBI to sum 'Locations Coordinates'[TotalCost] for each row of JIRA, you'll need an iterator:
Measure = SUMX( JIRA, RELATED( 'Locations Coordinates'[TotalCost] ) )
Thank you for your reply. I will try to explain my case better. In JIRA table I have the date and the location that was made by someone. In the another table (LocationsCoordinate), I have every location with the costs. So, in JIRA will appear the same locatiom multiple times, but in LocationsCoordinate only once with the costs. I'm trying to, for every day that's in JIRA, calculate the costs that's in LocationsCoordinate. (I want the fisrt matrix. The second is just to demonstrate that was 7 dislocation to "Lisboa" for example (COUNT). The correct value should be 7* cost).