Forum Discussion
michaelstone
Helper I
7 years agoStrange behaviour with SAMEPERIODLASTYEAR
Hi, I'm building a Power BI report which is analysing PoS transaction data so have a fact table (Transactions) with every individual transaction including timestamp and sales amount (Transactions...
- 7 years ago
Hi michaelstone ,
Sorry for my mistake.
Please modify the measure Total Sales - Previous Year like below.
Total Sales - Previous Year = SUMX ( 'Calendar', CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) ) )Here is the output.
Best Regards,
Cherry
michaelstone
Helper I
7 years agoHi v-piga-msft ,
Here is a link to a file which shows the issue.
Note that the end date is now 17 July so you need to have this as the end date to see the issue.
Thanks,
Michael
v-piga-msft
Resident Rockstar
7 years agoHi michaelstone ,
By my test and research based on your pbix, I'm afraid that you should create the table with the date column from Calendar table like below so that you could get the correct output.
Best Regards,
Cherry