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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
flintstone
Helper II
Helper II

Convertir datos acumulativos en datos no competitivos

Tengo datos de consumo de energía en tiempo real con una marca de tiempo que fluye desde un websocket.

16/7/2020 00:00.00 6

16/7/2020 00:00.00 14

16/7/2020 00:00.00 17

16/7/2020 00:00.00 34

Me gustaría que Powerbi mostrara los valores no acumulativos como se muestra a continuación en la columna lat

16/7/2020 00:00.00 6 6

16/7/2020 00:00.00 14 8

16/7/2020 00:00.00 17 3

16/7/2020 00:00.00 34 17

Cualquier ayuda sería apreciada.

14 REPLIES 14
flintstone
Helper II
Helper II

Lamentablemente, ambos conjuntos de códigos en Power bi no funcionaron. Ahora he incluido los datos más grandes en el enlace

https://www.dropbox.com/s/kvagdhivzvhzq1w/energy.pbix?dl=0

¡Hola! ¿Alguna idea/soluciones hasta ahora?

Hola

¿Qué problema enfrentaste con mi fórmula?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

¡Hola! He aplicado su fórmula y los resultados no fueron consistentes. Donde faltaban datos, obtengo resultados negativos. Cuando había números post y postive, debería mostrar la diferencia. Pero no lo hizo.

Se puede ver es el enlace dropbox que había adjuntado.

Hola

Algo extraño está pasando en ese archivo. Cuando pego mi fórmula en una columna calculada, recibo un mensaje que dice "Trabajando en ella". No sé por qué está pasando esto. Lo siento.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hola

Esta fórmula de columna calculada funciona

Column = Casting[Incoming 33kv]-LOOKUPVALUE(Casting[Incoming 33kv],Casting[DateTimeStamp],CALCULATE(MAX(Casting[DateTimeStamp]),FILTER(Casting,Casting[DateTimeStamp]<EARLIER(Casting[DateTimeStamp]))))

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mahoneypat
Employee
Employee

Suponiendo que el componente time de los valores DateTime no son todos ceros, puede usar una expresión como esta para obtener el resultado en una medida. Use la medida en un objeto visual de tabla con la columna DateTime. Avísame si necesitas la versión de columna en su lugar.

Actual Consumption =
VAR __thisvalue =
    MIN ( Table[EnergyConsumed] )
VAR __thisdatetime =
    MIN ( Table[DateTime] )
VAR __prevdatetime =
    CALCULATE (
        MAX ( Table[DateTime] ),
        ALL ( Table[DateTime] ),
        Table[DateTime] < __thisdatetime
    )
VAR __prevvalue =
    CALCULATE (
        MIN ( Table[EnergyConsumed] ),
        ALL ( Table[DateTime] ),
        Table[DateTime] = __prevdatetime
    )
RETURN
    __thisvalue - __prevvalue

Si esto funciona para usted, márquelo como la solución. Los elogios también son apreciados. Por favor, avísame si no.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Gracias, Pat. Me metió en el código, pero se encontró con algunos errores como resaltado en rojo

PBI cumm .png

Tenía un error tipográfico en mi post original, con una variable que se hace referencia a sí misma. Edité ese post. Para tu información que lo que proporcioné era que una expresión de medida se usara en un objeto visual de tabla, no para una columna calculada.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Actualmente estamos ejecutando la fórmula en todo el conjunto de datos. Si es agradable para todos, me gustaría mantener esta conversación abierta hasta que tengamos la confirmación de que la fórmula resuelve el problema. Esto no tomará mucho tiempo.

hola @flintstone

¿Podría por favor compartir su archivo pbix de muestra para que tengamos una prueba, que será una gran ayuda.

saludos

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

¿Cómo subo el archivo pbix? Lo intenté, pero hay un mensaje de error "El tipo de archivo (.pbix) no es compatible"

hola @flintstone

Para su caso, simplemente cree una nueva columna como se muestra a continuación:

Column =
VAR __prevdatetime =
    CALCULATE (
        MAX ( Casting[DateTimeStamp] ),
        FILTER ( Casting, Casting[DateTimeStamp] < EARLIER ( Casting[DateTimeStamp] ) )
    )
RETURN
    Casting[Incoming 33kv]
        - CALCULATE (
            SUM ( Casting[Incoming 33kv] ),
            FILTER ( Casting, Casting[DateTimeStamp] = __prevdatetime )
        )

Resultado:

2.JPG

saludos

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.