Forum Discussion
Sameperiod LASTYEAR MTD
Hi Everyone,
Here is the issue:
Need to compare the revenue of 1st Jul'21 - 8th Jul'21 with the revenue of 1st Jul'20 - 8th Jul'20. When I use:
Calculate([total revenue],SAMPEPERIODLASTYEAR(dimdate[date]))
It compares the following:
revenue of 1st Jul'21 - 8th Jul'21 with the revenue of 1st Jul'20 - 31st Jul'20
Please help.
6 Replies
- Selva_SalimiFrequent Visitor
Hi sandy8910
you can add a filter to your measure expression:
calculate([total revenue]),SAMEPERIODLASTYEAR('dimdate'[date]),filter('Table', DAY('Table'[date])<= DAY(max('Table'[date]))))Did I answer your question? Mark my post as a solution!- sandy8910Frequent Visitor
Thansk Selva for help.
When I apply filter on dim table it gives nothing. No error. No value. can you please specifiy if you are refering to apply the filter on the data table where I am pulling the revenue from?
- Selva_SalimiFrequent Visitor
@sandy8910 yes, you should add filter on the table where you are pulling the revenue from
- Ashish_Mathur
Super User
Hi,
Ensure that the last date in the Dimdate table goes only uptil today's date.
- sandy8910Frequent Visitor
Thanks Ashish however that I dont want to do as other visuals are using future dates as well
- Ashish_Mathur
Super User
Hi,
Share the link from where i can download your PBI file and show the expected result.