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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.