Forum Discussion
Use dynamic measures to replicate Excel bar chart
- 3 years ago
Hi Anonymous ,
According to your description, here's my solution.
1.Create a new table. Don't make relationship between the two tables.
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:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
According to your description, here's my solution.
1.Create a new table. Don't make relationship between the two tables.
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:
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.
- Anonymous3 years agoNot applicable
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!
- Anonymous3 years agoNot applicable
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