Forum Discussion
Percentage Sum Total
I would like to write a new measure to calculate the % of the total for the period. I can calculate the sum score for the whole table, but not by the period. Thanks,
Company Period Score % total for the period
A Q1 2 16.7%
A Q2 3 27.3%
B Q1 4 33.3%
B Q2 5 45.5%
C Q1 6 50%
C Q2 3 27.3%
You may try using ALLSELECTED Function.
Measure = DIVIDE ( SUM ( Table1[Score] ), CALCULATE ( SUM ( Table1[Score] ), ALLSELECTED ( Table1[Company] ) ) )
3 Replies
- VvelardeCommunity Champion
Hi, try with this measure
% Total for Period = VAR TotalPeriod = CALCULATE ( SUM ( Table1[ Score ] ), ALLEXCEPT ( Table1, Table1[ Period ] ) ) RETURN DIVIDE ( SUM ( Table1[ Score ] ), TotalPeriod )Regards
Victor
- siuchanFrequent Visitor
Thanks for your suggestion. I tried it. But, it gave me the sum of the whole table. only If i specific the time period with the slider, they i can get the total sum % at the specific period.
- v-chuncz-msftCommunity Support
You may try using ALLSELECTED Function.
Measure = DIVIDE ( SUM ( Table1[Score] ), CALCULATE ( SUM ( Table1[Score] ), ALLSELECTED ( Table1[Company] ) ) )