Forum Discussion
SAMEPERIODLASTYEAR View
If you do not have a calendar table, please create one and create relationship between the calendar table and the fact table.
In following screenshot, Table1 is the original fact table, Table2 is the crossjoin table.
Now you can create a measure with following DAX formula.
Measure = CALCULATE ( SUM ( Table2[Sales] ), SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) )
Best Regards,
Herbert
Herbert
I got your sample and have been trying to replicate the sample with my dataset.
Is there a way I can share my file with you to take a look and help me get it to work?
Let me know how I can send you a file to review.
I am trying to get this finished before the end of the week if at all possible.
Thanks
Much appreciated.
Brian
- bberglund8 years agoFrequent Visitor
This is the sample file look before i add the changes you had suggested.
So I'd like to send this to you as a pbix and see if you can assist with the lower left chart for the last year data.
- v-haibl-msft8 years agoMicrosoft Employee
You can share the pbix file througn online file service like OneDrive.
Best Regards,
Herbert- bberglund8 years agoFrequent Visitor
I sent you the file via private message.
Can you let me know if you got it?