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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
gibaprado
New Member

Coluna personalizada no Power Query

Como incluir uma coluna personalizada que multiplique uma coluna com valor inteiro por uma coluna de hora? O Excel converte a hora em número serial e multiplica normalmente, mas no power query não estou conseguindo.

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

jgeddes_0-1740516536303.png
jgeddes_1-1740516554443.png

jgeddes_2-1740516592607.png

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
Omid_Motamedise
Super User
Super User

To multiply an integer column by a time column in Power Query, first ensure the time column is in the "time" data type. Then, create a custom column using the formula

= [IntegerColumn] * (Duration.From([TimeColumn]) / #duration(1, 0, 0, 0))

 

This converts the time column to a duration (fraction of a day) and multiplies it by the integer column. The result will be the integer value multiplied by the equivalent hours from the time column.

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h
ronrsnfld
Super User
Super User

It works in Excel because Excel stores times as numbers.

But what is your point of this multiplication in Power Query?

 

I ask because Power Query does has both a Time data type as well as a Duration data type.  In Excel, both are stored as numbers and can be displayed in a variety of methods.

 

In Power Query, a "time" data type cannot be equal to or greater than 24 hours.

A "duration" data type can be, and can be multiplied by an integer with the result being a duration.

 

If you are really multiplying a Duration by an integer, then ensure your "time" is a Duration type, and merely multiply it.

jgeddes
Super User
Super User

jgeddes_0-1740516536303.png
jgeddes_1-1740516554443.png

jgeddes_2-1740516592607.png

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors