Forum Discussion
Calculate Measure using a relationship
- 7 years ago
You are going to have to modify the measure to take Team totals into account. It is basically the same process as grand total lines. Check out my Matrix Measure Triple Threat Rock and Roll.
You can create a couple of measures and you want to use Measure 2 in your table visualization. Based on this Quick Measure, Measure Totals, The Final Word:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Measure = SUMX(FILTER(ALL(Table2),'Table2'[Contract]=MAX('Table1'[Contract])),[Sales])*MAX([%])
Measure 2 =
VAR __sum = SUMX('Table2',[Sales])
RETURN
IF(HASONEVALUE('Table1'[Team]),[Measure],__sum)
Attached PBIX for your reference.
Greg_Deckler Tx for your reply, with the measure you propose I can see that the calculation works on the contract level, however when introducing a slicer on the Team, totals per team do not match the sum of their contracts. When looking at individual teams Totals should match the sum of their contracts, when not selecting any team total should be total of the contracts (without duplication)
In this case Total
Team A = 365
Team B = 470
Grand Total (without slicing on team) 750
- Greg_Deckler7 years agoCommunity Champion
You are going to have to modify the measure to take Team totals into account. It is basically the same process as grand total lines. Check out my Matrix Measure Triple Threat Rock and Roll.