Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Good morning,
I have been struggling for some time with displaying percentages relative to the column total (the month), but only get the percentages displayed of the total (the year). I've searched a lot on the internet but I really can't figure it out. Hopefully you can help me further.
I want to translate this table into percentages where each month is 100%:
I have used different formulas, but the filters from the date table that are selected in the report (month and year) will continue to relate to the output. For now I use the following formula:
% Hour type =
VAR X =
SUM(Hours[Hours])
VAR Y =
SUMX(
ALLSELECTED(Hours),
Hours[Hours])
RETURN
DIVIDE(X,Y)
The table looks like this:
I have tried ALL instead of ALLSELECTED to, but then the year is not taken into to calculation...
I use the following tables:
Date table (for the months)
Hour table (for the hours)
Hour type table (for the translation of the hours)
Hopefully you can help me out guys, I'd really appreciate it.
Kind regards,
Ramon
Solved! Go to Solution.
@Anonymous , Try like
DIVIDE(SUM(Hours[Hours]),calculate(SUM(Hours[Hours]),allexcept(Table,Table[Month])))
@Anonymous , Try like
DIVIDE(SUM(Hours[Hours]),calculate(SUM(Hours[Hours]),allexcept(Table,Table[Month])))
I found the solution and it was much closer than expected. Feel very stupid and a waste of time.
Displaying the option value as a percentage of column total had completely eluded me.
In any case, thank you very much for the effort !
Hi Amitchandak,
Thank you for your reaction!
Unfortunately, the formula doesn't seem to work...`I have hours of 2019 and 2020. And now te percentages where calculate for both years together...
% hour type = DIVIDE(SUM(Hours[Hours]),calculate(SUM(Hours[Hours]),allexcept(Date table,Date table[Month])))
Is there anything I can do to clarify the problem?
Kind regards,
Ramon
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |