Forum Discussion
pawelj795
Post Prodigy
6 years agoMultiply Minutes times Quantity
Hi, I have two measures like below. Now, I want to multiply them, but when I do that, the results are decimal numbers. How to change them to Minutes/Hours?
v-gizhi-msft
Community Support
6 years agoHi,
Please try this measure:
Measure = FORMAT(SUM(TSENB_CUSTINVOICETRANS[QTY])*SUM('Production Standards'[Time]),"HH:MM:SS")Hope this helps.
Best Regards,
Giotto
pawelj795
Post Prodigy
6 years agov-gizhi-msft
Your solution works, thanks.
But, I can't figure out issue with suming time (Total).
Why isn't correct?
- pawelj7956 years ago
Post Prodigy
Same issue even with columns.
- v-gizhi-msft6 years ago
Community Support
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
- pawelj7956 years ago
Post Prodigy
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.
- amitchandak6 years ago
Super User
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")