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.
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.
@Anonymous,
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!
@Anonymous,
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!
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 |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |