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

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors