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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Meep
Frequent Visitor

Use dynamic measures to replicate Excel bar chart

Hi everyone,

 

New to Power BI here and I am stuck with this chart. 

 

I want to replicate this win rate chart that I had created in Excel:

 

 Oct 2022Oct 2021
Overall Win Rate15.0%16.0%
Supplier 1 Win Rate8.2%9.3%
Supplier 2 Win Rate21.2%12.7%
Supplier 3 Win Rate40.3%25.4%

 

Meep_0-1668682545339.png

 

 

I created the measures to calculate all the percentages in Power Bi, but I cannot replicate the chart design because for some reason they are stuck to each other: 

 

Meep_1-1668682664437.png

 

I was thinking about creating a table from the measures, but they are no longer dynamic which means the chart will be useless. Any idea how i could separate the columns to make it look like the ones in Excel?

 

Thank you.

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @Meep ,

According to your description, here's my solution.

1.Create a new table. Don't make relationship between the two tables.

vkalyjmsft_0-1668763448092.png

2.Create a measure. In the code, [Overall Win Rate], [Supplier 1 Win Rate] etc. are all measures.

Measure =
SWITCH (
    MAX ( 'Category'[Category] ),
    "Overall Win Rate", [Overall Win Rate],
    "Supplier 1 Win Rate", [Supplier 1 Win Rate],
    "Supplier 2 Win Rate", [Supplier 2 Win Rate],
    "Supplier 3 Win Rate", [Supplier 3 Win Rate]
)

Put the new Category column in X-axis, measure in Y-axis and Year-Month column in Legend, get the result:

vkalyjmsft_1-1668763584592.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @Meep ,

According to your description, here's my solution.

1.Create a new table. Don't make relationship between the two tables.

vkalyjmsft_0-1668763448092.png

2.Create a measure. In the code, [Overall Win Rate], [Supplier 1 Win Rate] etc. are all measures.

Measure =
SWITCH (
    MAX ( 'Category'[Category] ),
    "Overall Win Rate", [Overall Win Rate],
    "Supplier 1 Win Rate", [Supplier 1 Win Rate],
    "Supplier 2 Win Rate", [Supplier 2 Win Rate],
    "Supplier 3 Win Rate", [Supplier 3 Win Rate]
)

Put the new Category column in X-axis, measure in Y-axis and Year-Month column in Legend, get the result:

vkalyjmsft_1-1668763584592.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yanjiang-msft,

 

Thank you very much for the help. I replicated your work and even got the columns to be in the correct order by labelling the values in the Category column as A B C D. I also got it to display the rates in the correct order (2022 first instead of 2021) by creating a dummy table containing A B C D and 1 2 3 4. I then created a relationship between Category table and Dummy table and instead of using Category in X axis, I used the column in the Dummy table containing the 1 2 3 4 values. 

 

Very neat trick and thank you for the help!

Hi @v-yanjiang-msft ,

 

Thank you for the help. I will give it a try this morning. Do you know if those measures in the table will stay dynamic and change accordingly when I switch the filter applied to the measures or if new data comes in?

 

Thank you

amitchandak
Super User
Super User

@Meep , if these 4 are measures then you can create calculation groups and use that on axis

 

Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.