Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Needs to have same dates in Previous Year Using DAX

I have some Random Dates From Current Year and I want to have same Dates in Previous Year. I tried below DAX to do that but i am not able to access table Varibale below.   First I get all dates in ...
  • v-jiascu-msft's avatar
    v-jiascu-msft
    7 years ago

    Hi Anonymous,

     

    Try the demo in the attachment, please. You need a date table in your scenario.

    Measure =
    IF (
        MIN ( Fact_Sales[Offer Flag] ) = -1,
        BLANK (),
        CALCULATE (
            SUM ( Fact_Sales[Sales_Amount] ),
            SAMEPERIODLASTYEAR ( 'Calendar'[Date] )
        )
    )
    

    Needs_to_have_same_dates_in_Previous_Year_Using_DAX

     

    Best Regards,

    Dale