Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

powerbi - Power BI 100% stacked area chart

Hi I am wanting to get the same effect as the '100% stacked column chart' but using an area chart visual. I think the best way would be to create a measure. So far I have created a measure for the percentage

Percentage = COUNT(Locations[Latest Rating]) / CALCULATE(COUNT(Locations[Latest Rating]), ALLSELECTED(Locations))

And get the values: enter image description here

However want the % out of 100. So for example "Good = 1.30%" I know the calculation should be 1.30/1.91 *100 so should be 68%. Not sure the best way to calculate this. Using a legend on the visual also.

question from:https://stackoverflow.com/questions/65844156/power-bi-100-stacked-area-chart

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can use DAX and the Stacked Area Chart to produce a visual totalling 100%

With a starting point of the following data

Quality Level Source Data

Use DAX to calculate the daily quality rating percentage, by dividing the value by the sum of ratings across all Quality Levels (Good, Outstanding etc)

Quality Rating Percentage = 
DIVIDE(
    SUM(Locations[Rating]),
    CALCULATE(
        sum(Locations[Rating]),
        ALL(Locations[Quality Level])
    )
 )

Add the stacked area chart to view the daily change of quality with like

Stacked Area Chart to 100%


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...