Forum Discussion

rjekrej's avatar
rjekrej
Frequent Visitor
2 years ago

Problem with same periode last year

Hi everyone

 

I have fact table with some sales. The table records the sales per day. I also have a dimesion kalender table and a relationship between the two tables. The calendertable has dates into the future. I would like a dax formula the can show me the sales today 6 months ago. Can anyone help with that?

 

Sincerely

Christian

2 Replies

  • Hi,

    I am not sure how your datamodel looks like but I tried to create a sample pbix file like below.

    Please check the below picture and the attached pbix file.

    I hope the below can provide some ideas on how to create a solution for your datamodel.

     

     

     

    Sales total: = 
    SUM( Sales[Sales] )

     

    Sales 6 months ago: =
    CALCULATE ( SUM ( Sales[Sales] ), DATEADD ( 'Calendar'[Date], -6, MONTH ) )