Forum Discussion
dataandme
2 years agoFrequent Visitor
Sales PY for Non Contiguous date range
Hi, I was using the below calculation to find the PY Sales Value, Sales SPLY = Calculate([Sales],SAMEPERIODLASTYEAR('sales'[Sales Date])) but get the error SAMEPERIODLASTYEAR expects a contiguou...
- 2 years ago
Hey dataandme ,
don't you have a calendar / date table? If not, you should build one, connect it with the fact table with 1:* realationship (from 'Calendar'[Date] to 'Sales'[Sales Date]), then use this calendar table in your calculate, instead of Calculate([Sales],SAMEPERIODLASTYEAR('sales'[Sales Date]))
it becomes Calculate([Sales],SAMEPERIODLASTYEAR('Calendar'[Date]))
😉
Rupak_bi
Super User
2 years agoPlease share sample data and desired out put.