Forum Discussion

POWER_TESTING's avatar
8 years ago
Solved

100% stacked bar

Hi Community,

 

how can i write expression for 100% staked bar chart.

Sample data....

BI Tool	        Area	        Sales
Qlikview	Europe	        100
Qlikview	North America	200
Qlikview	Scandinavia	300
Qlikview	South America	125
Spotfire	Europe	        352
Spotfire	North America	65
Spotfire	Scandinavia	95
Spotfire	South America	46
PowerBI	        Europe	        58
PowerBI	        North America	54
PowerBI	        Scandinavia	23
PowerBI	        South America	156
Qlik Sense	Europe	        292
Qlik Sense	North America	60
Qlik Sense	Scandinavia	300
Qlik Sense	South America	80

I have to show 

Dimensions:  BI Tools and Area

general expression like Sum(Sales)/Sum(ALL Sales)

 

Please can any one help me...

 

Thanks in Advance.....

  • Following is one of the ways to achieve this

     

    = DIVIDE(SUM('Table'[Sales]),CALCULATE(SUM([Sales]),FILTER(ALL('Table'),[Area]<>"")))

2 Replies

  • mitsu's avatar
    mitsu
    Resolver IV

    Following is one of the ways to achieve this

     

    = DIVIDE(SUM('Table'[Sales]),CALCULATE(SUM([Sales]),FILTER(ALL('Table'),[Area]<>"")))

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi POWER_TESTING,

     

    Actually, if you use a 100% stacked bar chart to display above data, there is no need to write expression, it will calculate percentage (sales/total sales) automatically. Please see:

     

    If I have something misunderstood, please provide more description about your desired output. Please illustare how to Sum(Sales) and what is ALL Sales. Some sales per [BI tool] or per [Area] or acorss whole table?

     

    Regards,

    Yuliana Gu