Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
k_ate_e
New Member

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
v-yulgu-msft
Employee
Employee

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] <= topvalue10 )

 

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.

View solution in original post

1 REPLY 1
v-yulgu-msft
Employee
Employee

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] <= topvalue10 )

 

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.