Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Percentages of column total

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%:

Steen92_3-1606467776811.png

 

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:

Steen92_2-1606467743255.png

 

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

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try like

DIVIDE(SUM(Hours[Hours]),calculate(SUM(Hours[Hours]),allexcept(Table,Table[Month])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Try like

DIVIDE(SUM(Hours[Hours]),calculate(SUM(Hours[Hours]),allexcept(Table,Table[Month])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

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 !

Anonymous
Not applicable

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])))

Steen92_0-1606470884623.png

Is there anything I can do to clarify the problem?

 

Kind regards,
Ramon

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.