cancel
Showing results for
Did you mean:

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Regular Visitor

## Cumulative Total not working properly for the current year

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.

4 REPLIES 4
Community Support

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.

Solution Sage

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..

Regular Visitor

Thanks @tamerj1 , it's close but its not quite there

Super User

A quick fix could be

PY New =

SUMX (

SUMMARIZE ( 'Date', 'Date'[Year], 'Date'[Month] ),

[PY]

)

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors