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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

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.
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
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.