Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k 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 Answer

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%


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...