Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I am trying to calculate the total sales from 8/1/2016 to Today's date last year but dynamically so it would work with a date slicer 'before" date. The formula works, but the total does not change when I change the end date on the slicer. It seems to be stuck on TODAY no matter the date range. I don;t want to specify a end date as I want it to update autmatically on refresh daily.
Any help would be appreciated.
Total PY Sales = CALCULATE(SUM('PRODDTA F42119'[2016 SCH Sales]),SAMEPERIODLASTYEAR(DATESBETWEEN('PRODDTA F42119'[G/L Date].[Date],"8/1/2017",TODAY())))
Solved! Go to Solution.
HI @DarylM,
Based on test, today function not works in datebetween function, I'd like to suggest you to manual calculate date range to instead the 'datebetween' function.
Dynamic = CALCULATE(SUM('Sample'[Sales]),FILTER(ALL('CALENDAR'),[Date]>=DATE(2016,8,1)&&[Date]<=DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))))
Regards,
Xiaoxin Sheng
HI @DarylM,
Based on test, today function not works in datebetween function, I'd like to suggest you to manual calculate date range to instead the 'datebetween' function.
Dynamic = CALCULATE(SUM('Sample'[Sales]),FILTER(ALL('CALENDAR'),[Date]>=DATE(2016,8,1)&&[Date]<=DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))))
Regards,
Xiaoxin Sheng
I would like to be able to slide the slicer back to view previous data which is why I am trying to find a dynamic way to calculate the data. If I use the MAX(End of Month) Same Time last Year, I get the whole total from 8/1 to 12/31 instead of just the last GL date as of the current year for last year. Hope this makes sense.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |