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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
pawelj795
Post Prodigy
Post Prodigy

Multiply Minutes times Quantity

Hi,
I have two measures like below.
image.pngimage.png


Now, I want to multiply them, but when I do that, the results are decimal numbers.
How to change them to Minutes/Hours?

11 REPLIES 11
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try this measure:

Measure = FORMAT(SUM(TSENB_CUSTINVOICETRANS[QTY])*SUM('Production Standards'[Time]),"HH:MM:SS")

Hope this helps.

 

Best Regards,

Giotto

@v-gizhi-msft 
Your solution works, thanks.

But, I can't figure out issue with suming time (Total).

Why isn't correct?
image.png

@pawelj795 , for correct GT you have force row context, try like

Measure = FORMAT(SUMX(Summarize('Production Standards', 'Production Standards'[Item],"_1",Sum(TSENB_CUSTINVOICETRANS[QTY]),"_2",SUM('Production Standards'[Time])),[_1]*[_2]),"HH:MM:SS")
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Same issue even with columns.
image.png

Hi,

 

It is because the measure total depends on context not the current field in visual.

This is a classical measure total issue.

Please try this:

Measure =
FORMAT (
    SUMX (
        DISTINCT ( TSENB_CUSTINVOICETRANS[Item name] ),
        TSENB_CUSTINVOICETRANS[QTY] * 'Production Standards'[Time]
    ),
    "HH:MM:SS"
)

Hope this helps.

 

Best Regards,

Giotto

@v-gizhi-msft 
@amitchandak 

I tried both of your's solution but it still didn't work.

In some cases the results are correct but in most cases are incorrect.

image.png

amitchandak
Super User
Super User

@pawelj795 , New column in minute

New column = hour([Time])*60 + minute([Time]) // Change data type from whole number to decimal

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

The problem is that I have indirect relationship between these two tables.
That's why I must use measures instead of columns.

You can use

sumx(Table,hour(Table[Time])*60 + minute(Table[Time]))

But mutiplcation need to done on a common row context . Refer

https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Differ...

 

You may have use summarize or values

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 
Okay I get it, thanks.

But is there any way to display hours/minutes/seconds in measure as time format like below column?
image.pngimage.png

@pawelj795 , refer https://community.powerbi.com/t5/Desktop/Sum-of-H-MM-SS/td-p/124007

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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