Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Reply
seancasey
Regular Visitor

Cumulative Total not working properly for the current year

seancasey_0-1650453861046.png

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
v-rongtiep-msft
Community Support
Community Support

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.

Power BI: Totals Incorrect 

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

Whitewater100
Solution Sage
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..

seancasey
Regular Visitor

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

 

tamerj1
Super User
Super User

@seancasey 

A quick fix could be

PY New = 

SUMX (

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

    [PY]

)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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