cancel
Showing results for
Did you mean:
Highlighted
Visitor

## Bar chart with top 5% of each bar a different colour

I have been trying to solve a problem for days now, and it's driving me absolutely crazy - any help is very much appreciated!

I have 3 columns: Date, Item and Quantity. All I am trying to achieve is a bar chart where the x-axis is the day (easy enough), then the y axis is the total quantity per day (again, easy), but then I would like to show how much of the daily quantity has been created by the top 5% of the daily items - similar to a pareto, if the 80/20 split was shown on a bar graph

The number of items changes each day, which is why I can't use the top N function. From reading, I have been able to rank my items within each day, but I have no idea where to go from here!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: Bar chart with top 5% of each bar a different colour

Hi @k_ate_e,

Suppose you have had a [Rank] measure. Then, please add below measure to visual level filter and set its value to 1.

`check =VAR topvalue =    ROUND (        CALCULATE ( DISTINCTCOUNT ( 'Table'[items] ), ALLSELECTED ( 'Table' ) ) * 0.05,        0    )RETURN    IF ( [Rank] <= topvalue, 1, 0 )`

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Support Team

## Re: Bar chart with top 5% of each bar a different colour

Hi @k_ate_e,

Suppose you have had a [Rank] measure. Then, please add below measure to visual level filter and set its value to 1.

`check =VAR topvalue =    ROUND (        CALCULATE ( DISTINCTCOUNT ( 'Table'[items] ), ALLSELECTED ( 'Table' ) ) * 0.05,        0    )RETURN    IF ( [Rank] <= topvalue, 1, 0 )`

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.