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
AMVondra
Regular Visitor

Power Query | Sum Multiple Varied Columns per Row

Dear Colleagues.

 

I have a task to sum multiple columns (with time durations) amount (will increase) per row. And I didn't know how to do it and didn't find any solutions. My last rows of code are below. Could You please help me with it?

 

 

#"Changed Type1" = Table.TransformColumnTypes(#"Pivoted Column",{{"Maternity Leave", type duration}, {"Annual Leave", type duration}, {"Sick Leave", type duration}}),
#"Replaced Value1" = Table.ReplaceValue(#"Changed Type1",null,#duration(0, 0, 0, 0),Replacer.ReplaceValue,{"Maternity Leave", "Annual Leave", "Sick Leave"}),

 

 Thanks in advance 🤝

5 REPLIES 5
serpiva64
Solution Sage
Solution Sage

Hi,

i do not understand well your problem.

If it is to sum some columns of type duration you can do this way

serpiva64_0-1678904793525.png

If the problem is another, try to explain again.

 

The issue is that amount of columns will be increasing for some time and now there are 35 columns, tomorrow it can be already 40 columns. So I don't know how to sum data from the dynamic range of columns. My data is just an example to understand the structure of data.

AMVondra
Regular Visitor

And really, nobody knows how to resolve it?

serpiva64
Solution Sage
Solution Sage

Please, post some sample data

@serpiva64 here is the link https://drive.google.com/file/d/15pAz6BYTMShXJY_h06Z8i3SLcTTWUqaL/view?usp=sharing Thanks a lot!

P.S. I've just added the column with the Total Absence Time to understand how it should be. So the last 2 rows of the code changed a little.

 

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.