Forum Discussion

abc_777's avatar
abc_777
Solution Specialist
3 years ago
Solved

hi

hi, 

 

measure sameperiod last year that shows 2022 all months sale to 2023. but i dont want to see. 

i want to see 2022 january to 2023 january then 2022 february to 2023 february and when march 2023 come then only show march 2022 same way april, may, june.

when they comes in 2023 then sameperiod 2022 months data also come up paralaly not before like in this screen shot

 

 

 

Same Month Previous Year Quantity =
CALCULATE([Total in Piece and KG (Measure)],
SAMEPERIODLASTYEAR(
    BMCalendar[Date]
)
)
  • Hi,

    I am not sure how your datamodel looks like, but please try something like below whether it suits your requirement.

     

    Same Month Previous Year Quantity =
    VAR _condition =
        DIVIDE ( [Total in Piece and KG (Measure)], [Total in Piece and KG (Measure)] )
    RETURN
        _condition
            * CALCULATE (
                [Total in Piece and KG (Measure)],
                SAMEPERIODLASTYEAR ( BMCalendar[Date] )
            )
    

1 Reply

  • Hi,

    I am not sure how your datamodel looks like, but please try something like below whether it suits your requirement.

     

    Same Month Previous Year Quantity =
    VAR _condition =
        DIVIDE ( [Total in Piece and KG (Measure)], [Total in Piece and KG (Measure)] )
    RETURN
        _condition
            * CALCULATE (
                [Total in Piece and KG (Measure)],
                SAMEPERIODLASTYEAR ( BMCalendar[Date] )
            )