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

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

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.