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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join 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
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

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.