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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
BrianNeedsHelp
Helper III
Helper III

Calculation Enigma

I compute this year's daily goals based on last year/same month.  I get previous year like this- 364 days previous is the same weekday so it aligns properly.  

PYGA1=CALCULATE( 'Subscriber Activity'[Gross Adds],DATEADD('Calendar'[Calendar Date],-364,DAY)))

 Works great except then end of the month numbers are higher than they should be because it's calculating last year's first of the month on the last day of the month.  To correct it I did this: 

PYGA1 = IF('Calendar'[EndofMOnth]=DAY(SELECTEDVALUE('Calendar'[Calendar Date])),CALCULATE( 'Subscriber Activity'[Gross Adds],DATEADD('Calendar'[Calendar Date],-371,DAY)),CALCULATE( 'Subscriber Activity'[Gross Adds],DATEADD('Calendar'[Calendar Date],-364,DAY)))

It adjusts the last day of the month, but the total adds up to the same as it did when there was just the -364 measure.  So the PYALLGAs1 is showing the same total as it did in the first measure so it doesn't adjust each day higher like it should.  The goal for each day stays the same.  Not sure how this is even possible?  Any help greatly appreciated  

PYALLGAs1 = CALCULATE([PYGA1],

ALL('MyCalendar'[Date]))
GAGOAL = [PYGA1]/[PYALLGAs1]*[LocQuota1]

 So the essential problem is that the sum 15,457 is not correct.  If i export this and add it up it comes to 15,227.  

BrianNeedsHelp_0-1748621718904.png

 

1 ACCEPTED SOLUTION

Tried parallel period but it put and astronomical number in each row. But I finally got the PYGA1 column to add up correctly by inputting another measure:  

SUMX(SUMMARIZE(MyCalendar,MyCalendar[Date]),CALCULATE(SUMX(MyCalendar,[PYGA1])))

View solution in original post

4 REPLIES 4
Deku
Super User
Super User

Try using parallelperoid('Calendar'[Calendar Date], -1, year )


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Hi @BrianNeedsHelp ,

 

Has your issue been resolved? If a community member's response addressed your query, please consider marking it as Accepted Answer and click Yes if you found it helpful.

If you have any further questions, feel free to reach out.
Thank you for being a valued member of the Microsoft Fabric Community Forum!

Tried parallel period but it put and astronomical number in each row. But I finally got the PYGA1 column to add up correctly by inputting another measure:  

SUMX(SUMMARIZE(MyCalendar,MyCalendar[Date]),CALCULATE(SUMX(MyCalendar,[PYGA1])))

Hi @BrianNeedsHelp ,

Thanks for the update, and well done on resolving the issue with the SUMX(SUMMARIZE(...)) approach and effective way to ensure the daily values aggregate correctly, especially when adjusting for edge cases like end-of-month alignment.

 

If everything looks good on your end now, we’d appreciate it if you could mark your solution as Accepted. This helps other users who may face similar challenges find guidance more easily.

Feel free to reach out if you need further assistance or want to explore additional improvements we are happy to help!!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.