Forum Discussion
undefined
- Anonymous2 years ago
Hi Anonymous
Thanks for the reply from aduguid.
Anonymous , the following testing is for your reference:
My sample:
Create a measure as follows
Measure = VAR _lmonthfirstday = EOMONTH(TODAY(), -2) + 1 VAR _lmonth = EDATE(TODAY(), -1) VAR _sum = CALCULATE(SUM('Table'[Value]), FILTER('Table', [Date] >= _lmonthfirstday && [Date] <= _lmonth)) RETURN _sumOutput:
Since I don't know what your data structure is like, I have only tested up to this point, so if the method has problems with your data, please provide some data so that I can better help you. How to provide sample data in the Power BI Forum - Microsoft Fabric Community . Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.
Best Regards,
Yulia XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I tried it but it does not work dear ,
actually , i have created a calendar spanning from 2014 to 2024 and used it as a filter to segment the dates (linked it to my table).
and i have created three measures for this purpose. However, I'm encountering difficulties with the "LAST MONTH'S SALES (SAME PERIOD)" measure.
my table is as below :