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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Porcentaje de variación entre dos periodos no consecutivos

Hola, espero que alguien pueda ayudarme, necesito comparar la variacion de ventas entre dos periodos, pero estos periodos no son consecutivos. 

En ROJO la variacion que me deberia salir, pero no consigo dar con la formula adecuada. Muchas gracias!

 

FY_TertialStart_Tertial_DateVENTASVARIACION
202119/1/2020       5,732,369 
202121/1/2021       7,605,33132.7%
202135/1/2021       8,368,26110.0%
202219/1/2021       9,033,1737.9%
202221/1/2022       8,480,562-6.1%
202235/1/2022       8,138,353-4.0%
202319/1/2022       4,204,960-48.3%
1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

Prueba con esta medida (en mi ejemplo, la tabla de se llama 'fTable')

 

% Variación =
VAR _PrevDate =
    CALCULATE (
        MAX ( fTable[Start_Tertial_Date] ),
        FILTER (
            ALL ( fTable ),
            fTable[Start_Tertial_Date] < MAX ( fTable[Start_Tertial_Date] )
        )
    )
VAR _PrevVentas =
    CALCULATE (
        SUM ( fTable[VENTAS] ),
        FILTER ( ALL ( fTable ), fTable[Start_Tertial_Date] = _PrevDate )
    )
RETURN
    DIVIDE ( SUM ( fTable[VENTAS] ) - _PrevVentas, _PrevVentas )

 

result.png





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

2 REPLIES 2
PaulDBrown
Community Champion
Community Champion

Prueba con esta medida (en mi ejemplo, la tabla de se llama 'fTable')

 

% Variación =
VAR _PrevDate =
    CALCULATE (
        MAX ( fTable[Start_Tertial_Date] ),
        FILTER (
            ALL ( fTable ),
            fTable[Start_Tertial_Date] < MAX ( fTable[Start_Tertial_Date] )
        )
    )
VAR _PrevVentas =
    CALCULATE (
        SUM ( fTable[VENTAS] ),
        FILTER ( ALL ( fTable ), fTable[Start_Tertial_Date] = _PrevDate )
    )
RETURN
    DIVIDE ( SUM ( fTable[VENTAS] ) - _PrevVentas, _PrevVentas )

 

result.png





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

Muchisimas gracias! ha funcionado perfectamente 😀

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.