Forum Discussion

Gpera's avatar
Gpera
Regular Visitor
2 years ago
Solved

Calculating percentage over date level

Hi,

As you can see I have a table with these data:

Share of Voice has been calculated as: 

divide('Adspend - Monthly data'[Spend ('000 Euro)], 'Adspend - Monthly data'[Total Category Spend ('000 Euro)])
But if i create another matrix just for years I get this results:

 


What I would like to have is a mesure that calculate correctly the percentage on column added, so sum of Spend over sum of Category by each level of granularity. 

Ex.  In Table 1:

2022 | 1 | 1010 | 2816 | 36%

Ex. In Table 2:

2022 | 6596 | 77913 | 8,4%

 

Could you please help me?

Thanks

  • Gpera,

     

    Try these measures. Percentages need to be calculated in a measure, not a column in the table; this allows them to dynamically calculate in the filter context of the visual.

     

    Sum of Spend = SUM ( Spend[Spend] )
    Sum of Total Category Spend = SUM ( Spend[Total Category Spend] )
    Share of Voice = DIVIDE ( [Sum of Spend], [Sum of Total Category Spend] )

     

     

     

1 Reply

  • Gpera,

     

    Try these measures. Percentages need to be calculated in a measure, not a column in the table; this allows them to dynamically calculate in the filter context of the visual.

     

    Sum of Spend = SUM ( Spend[Spend] )
    Sum of Total Category Spend = SUM ( Spend[Total Category Spend] )
    Share of Voice = DIVIDE ( [Sum of Spend], [Sum of Total Category Spend] )