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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Parthsh93
Helper IV
Helper IV

Comparación de tiempo con parámetros lógicos en MOM y YOY

En la tabla que se muestra a continuación, he hecho una comparación de intervalos de tiempo de los ahorros por mes.

Si considera la primera fila que asume que los datos del mes anterior de mi mes MIN es "0" y por lo tanto me da [datos de mes de 0-MIN] en Ahorro de carga o Ganancia/pérdida de LS

6.PNG

Quiero incluir una condición en mis medidas para que excluya el cálculo del primer mes y dé un espacio en blanco para esa fila en la tabla (aquí Fila de dic), pero todos los valores adicionales en las filas respectivas deben permanecer iguales.

Estas son mis medidas:

Loadability savings = SUMX(SUMMARIZE(dDate,dDate[Month],"_2",DIVIDE(SUMX('Prototype Modeling_Freight','Prototype Modeling_Freight'[Load Charge]),[Shipments],BLANK())*[Shipments Saved_trial]),[_2])
LS Gain/Loss = SUMX(SUMMARIZE(dDate,dDate[Month],"_3",[Loadability savings]-CALCULATE([Loadability savings],DATEADD(dDate[Date],-1,MONTH))),[_3])

6 REPLIES 6
Mariusz
Community Champion
Community Champion

Hola @Parthsh93

Prueba esto

LS Gain/Loss =
VAR __loadabilityPreviousMonth = 
    CALCULATE ( 
        [Loadability savings], 
        DATEADD ( dDate[Date], -1, MONTH ) 
    )
RETURN 
    IF ( 
        NOT ISBLANK( __loadabilityPreviousMonth ),
        [Loadability savings] - __loadabilityPreviousMonth
    )

Saludos
Mariusz

Si este post ayuda,entonces por favor considere aceptarlo como la solución.

Por favor, siéntase libre de conectarse conmigo.
Linkedin

@Mariusz Gracias, funcionó

Mariusz
Community Champion
Community Champion

Hola @Parthsh93

Prueba esto

LS Gain/Loss =
SUMX (
    SUMMARIZE (
        dDate,
        dDate[Month],
        "_3",
        VAR __loadability = [Loadability savings]
        RETURN
            IF (
                NOT ISBLANK ( __loadability ),
                __loadability
                    - CALCULATE ( [Loadability savings], DATEADD ( dDate[Date], -1, MONTH ) )
            )
    ),
    [_3]
)

Saludos
Mariusz

Si este post ayuda,entonces por favor considere aceptarlo como la solución.

Por favor, siéntase libre de conectarse conmigo.
Linkedin

7.PNG

@Mariusz He hecho una nueva medida como "prueba" con su opinión, pero conseguir esta discrepencia

amitchandak
Super User
Super User

@Parthsh93 , algo como esto

Ganancia/pérdida de LS ?
var _minx á eomonth(minx(allselected(ddate),dDate[Date]),0)
devolución
SUMX(SUMMARIZE(dDate,dDate[Month],"_3",[Ahorro de carga]-CALCULATE([Ahorro de carga],DATEADD(dDate[Date],-1,MONTH), dDate[Date]>_minx)),[_3])

Puede agregar este tipo de filtro en la fórmula deseada

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

hola @amitchandak he probado su opinión en "prueba 2",

pero da el mismo resultado

8.PNG

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors
Top Kudoed Authors