Hello,
I have been struggling to find the solution to show the percentage each category on the clustered column chart, such as this. the automated calculation takes from the total number of customers from all years. If you could tell me a Dax function, that would be very helpful.
What I would like to do:
(1) % of "Age" in total number of customers in the same "Date"
(2) % of "Age Group" in total number of customers in the same "Date"
Both need to work on Column chart.
Thanks for reading.
Age | Age Group | Number of customers | Date | % of age each year |
18 | 16 -19 yrs | 50 | 31/03/2022 | 33.33% |
19 | 16 -19 yrs | 40 | 31/03/2022 | 26.67% |
20 | 20 - 24 yrs | 60 | 31/03/2022 | 40.00% |
19 | 16 -19 yrs | 16 | 31/03/2023 | 3.16% |
20 | 20 - 24 yrs | 45 | 31/03/2023 | 8.88% |
21 | 20 - 24 yrs | 73 | 31/03/2023 | 14.40% |
22 | 20 - 24 yrs | 71 | 31/03/2023 | 14.00% |
23 | 20 - 24 yrs | 107 | 31/03/2023 | 21.10% |
24 | 20 - 24 yrs | 110 | 31/03/2023 | 21.70% |
25 | 25 - 29 yrs | 85 | 31/03/2023 | 16.77% |
20 | 20 - 24 yrs | 16 | 31/03/2024 | 3.79% |
21 | 20 - 24 yrs | 45 | 31/03/2024 | 10.66% |
22 | 20 - 24 yrs | 73 | 31/03/2024 | 17.30% |
23 | 20 - 24 yrs | 71 | 31/03/2024 | 16.82% |
24 | 20 - 24 yrs | 107 | 31/03/2024 | 25.36% |
25 | 25 - 29 yrs | 110 | 31/03/2024 | 26.07% |
21 | 20 - 24 yrs | 16 | 31/03/2025 | 5.13% |
22 | 20 - 24 yrs | 45 | 31/03/2025 | 14.42% |
23 | 20 - 24 yrs | 73 | 31/03/2025 | 23.40% |
24 | 20 - 24 yrs | 71 | 31/03/2025 | 22.76% |
25 | 25 - 29 yrs | 107 | 31/03/2025 | 34.29% |
22 | 20 - 24 yrs | 16 | 31/03/2026 | 7.80% |
23 | 20 - 24 yrs | 45 | 31/03/2026 | 21.95% |
24 | 20 - 24 yrs | 73 | 31/03/2026 | 35.61% |
25 | 25 - 29 yrs | 71 | 31/03/2026 | 34.63% |
Solved! Go to Solution.
Try these measures:
Total Customers = SUM ( Table1[Number of customers] )
% in Same Date =
VAR vNumerator = [Total Customers]
VAR vDenominator =
CALCULATE ( [Total Customers], ALLEXCEPT ( Table1, Table1[Date] ) )
VAR vResult =
DIVIDE ( vNumerator, vDenominator )
RETURN
vResult
Proud to be a Super User!
Try these measures:
Total Customers = SUM ( Table1[Number of customers] )
% in Same Date =
VAR vNumerator = [Total Customers]
VAR vDenominator =
CALCULATE ( [Total Customers], ALLEXCEPT ( Table1, Table1[Date] ) )
VAR vResult =
DIVIDE ( vNumerator, vDenominator )
RETURN
vResult
Proud to be a Super User!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!
User | Count |
---|---|
219 | |
68 | |
68 | |
58 | |
58 |
User | Count |
---|---|
251 | |
221 | |
104 | |
76 | |
70 |