I need help in forcing the calculation of PY to stop at the current day in this year. Month by Month is working as it should but the overall total at the bottom needs to stop at this day on year ago. Any help on this would be greatly appreciated.
Hi @seancasey
Please have a try.
Create a measure based on measure_CY.
measure =
VAR _a = [measure_CY]
VAR _b =
SUMMARIZE ( table, 'table'[date], "aaa", [measure_CY] )
RETURN
IF ( HASONEVALUE ( 'table'[date] ), _a, SUMX ( _b, [aaa] ) )
Or please refer to the blog to see if it helps you.
First solution for incorrect totals in Power BI: move from a calculated measure to a calculated column
Second solution: create a summarised table and use SUMX
f I have misunderstood your meaning, please provide you pbix file without privacy information and your desired output.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi:
If you base measure is Sales (just example) and you have PY Sales and YTD Sales etc all driven off this base measure, which should be coming in this year daily or whenever:
Start measure like so:
PY = IF(ISBLANK([Sales]), BLANK(), now go into your PY measure
example of full measure for PY stopping at last sales date in current year.(Below).
PY = IF(ISBLANK([Sales]), BLANK(), CALCULATE([Sales], SAMEPERIODLASTYEAR(Dates[Date]))
I hope this helps..
A quick fix could be
PY New =
SUMX (
SUMMARIZE ( 'Date', 'Date'[Year], 'Date'[Month] ),
[PY]
)