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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
pawelj795
Post Prodigy
Post Prodigy

Multiplicar minutos por cantidad

Hola
Tengo dos medidas como las que se muestran a continuación.
image.pngimage.png


Ahora, quiero multiplicarlos, pero cuando lo hago, los resultados son números decimales.
¿Cómo cambiarlos a Minutos/Horas?

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

Hola

Por favor, pruebe esta medida:

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

Espero que esto ayude.

Saludos

Giotto

@v-gizhi-msft
Tu solución funciona, gracias.

Pero, no puedo averiguar el problema con asumir el tiempo (Total).

¿Por qué no es correcto?
image.png

@pawelj795 , para GT correcto tienes contexto de fila de fuerza, tratar como

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

Mismo problema incluso con columnas.
image.png

Hola

Se debe a que el total de medida depende del contexto, no del campo actual en visual.

Este es un problema total de medida clásica.

Por favor, intente esto:

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

Espero que esto ayude.

Saludos

Giotto

@v-gizhi-msft
@amitchandak

Intenté la solución de las dos cosas, pero aún así no funcionó.

En algunos casos los resultados son correctos, pero en la mayoría de los casos son incorrectos.

image.png

amitchandak
Super User
Super User

@pawelj795 , Nueva columna en minutos

Nueva columna: hora([Tiempo])*60 + minuto([Tiempo]) // Cambiar el tipo de datos de número entero a 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

El problema es que tengo una relación indirecta entre estas dos tablas.
Es por eso que debo usar medidas en lugar de columnas.

Puede usar

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

Pero mutiplcation debe hacer en un contexto de fila común. recomienda

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

Es posible que haya utilizado suma o valores

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
Está bien, lo entiendo, gracias.

Pero, ¿hay alguna manera de mostrar horas/minutos/segundos en medida como formato de hora como el siguiente columna?
image.pngimage.png

@pawelj795 , consulte 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 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.