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.
Hi,
I'm trying to display the % of total sales for each groups name over a three year period but only where the country = X.
I can do this in a matrix using the percentage of column total function but am unable to display this in a line chart. Any suggestions how I might do this?
Group Name | Year | Sales | Country |
A | 2015 | X | |
A | 2016 | X | |
A | 2017 | X | |
B | 2015 | y | |
B | 2016 | y | |
B | 2017 | y | |
C | 2015 | X | |
C | 2016 | X | |
C | 2017 | X | |
D | 2015 | X | |
D | 2016 | X | |
D | 2017 | X | |
E | 2015 | y | |
E | 2016 | y | |
E | 2017 | y |
Thanks
Solved! Go to Solution.
Sorry. I seem to have made a mistake in my previous post. Try this:
Measure = DIVIDE ( SUM ( Table[Sales] ), CALCULATE ( SUM(Table[Sales]), ALL ( Table1[Group Name] ) ) )
Hi @arp
I think you can do the same in a line chart. Place the [Group Name] in the x-axis and Sales in values and choose Show as Percentage.
Set [Country in a slicer to restrict the calculation to 'X'
Hi,
This hasn't worked for me. The group names have filtered to those in country X but the percentage values are still being calculating on total sales rather than just sales in country X...
Hi @arp,
By my tests, I'm afraid the option Percent of column total is only for matrix visual currently in Power BI as it has Column Field.
For other charts, it only has Percent of grand total.
For your requirement, you'd better create a measure like AlB suggest to achieve that.
Best Regards,
Cherry
OK, then let's try with a measure in the values of the chart:
Measure = DIVIDE ( SUM ( Table[Sales] ), CALCULATE ( Table[Sales], ALL ( Table1[Group Name] ) ) )
and still with [Country] in the slicer to select "X" (or any other)
Thanks both for the replies.
I'm trying to set up the measure as suggested but I'm getting an error message saying that a single value for the sales column in the relevant table cannot be determined?
Sorry. I seem to have made a mistake in my previous post. Try this:
Measure = DIVIDE ( SUM ( Table[Sales] ), CALCULATE ( SUM(Table[Sales]), ALL ( Table1[Group Name] ) ) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |