Forum Discussion

siuchan's avatar
siuchan
Frequent Visitor
8 years ago
Solved

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%

 

 

3 Replies

  • Vvelarde's avatar
    Vvelarde
    Community Champion

    siuchan

     

    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

     

    • siuchan's avatar
      siuchan
      Frequent 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.