Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Here is a example of what I want to do.
Month Location Local sales Total Sales Percentage
May NYC 10 100 10%
May LA 10 100 10%
June NYC 20 100 20%
June LA 20 100 20%
July LA 30 100 30%
Aug LA 40 100 40%
I was doing a barchart using location as X-axis and using Month as slicer. If I want to see the percentage for total month, it should be Sum(Local sales)/sum(total sales) instead of just suming up all the percentages. How should I do that? Thank you
Solved! Go to Solution.
Okay, you have the answer in your first post. You can create a measure like so:
Answer = SUM(Table1[Local Sales])/SUM(Table1[Total Sales])
Then you can create a bar graph with the values as [Answer], Location as the axis, and a slicer with Month as value.
It will produce the following:
Hi @yiying
So just to clarify, what would you expect to see if your user selects May in the slicer based on your sample data?
A Barchart with just two bar:LA and NYC. Both showing 10%.
Yes. Selecting a single month is not a problem. When I select all the percentage become crazy because it just add up all the percentage.
What exactly do you expect to see when all months are selected? The Sum of the local sales divided by the sum of the total sales?
So, in the example you gave us, LA would be 100/400 = 25%.
Am I understanding this correctly?
Yes.
Or group by month. The percentage of July and Aug would be 70/200
Okay, you have the answer in your first post. You can create a measure like so:
Answer = SUM(Table1[Local Sales])/SUM(Table1[Total Sales])
Then you can create a bar graph with the values as [Answer], Location as the axis, and a slicer with Month as value.
It will produce the following:
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 33 | |
| 31 | |
| 29 |