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
MischaT
Frequent Visitor

DATESYTD Issue (Rolling Cumulation)

H there! 

 

I am having an issue with one of my rolling calculations for the below table:

  Number of Apples soldYTD Apples sold (rolling)Shop SalesApple + Shop Sales

YTD Apple + Shop Sales (Rolling)

 

(Calculating incorrectly)

Expected outcome
2022January000000
2022February000000
2022March180018000180001800
2022April0180023000250502300026850
2022May817958384508384523000110695
2022June08384595000179095118250289790
2022July475088845088845118250378635
2022August088845104550193645223050572280
2022September08884526900115995250200688275

 

The current Dax for "YTD Apple + Shop Sales (Rolling)" is 

YYTD Apple + Shop Sales (Rolling)= CALCULATE([Apple + Shop Sales],DATESYTD('Table'[Date],"28/02"))
and is not calculating correctly (I have included an expected value)
 
Please help!
The measure for "YTD Apples sold (rolling)" is similar:
YTD Apples sold (rolling) = CALCULATE(Number of Apples sold],DATESYTD('Table'[Date],"28/02"))
but it works correctly. 
 
Any suggestions?
Thanks as always!
1 ACCEPTED SOLUTION

Hi,

You can simplyfy the DAX a bit:

IF(

    isblank([Shops calc]),
    0,
    [Shops calc])

Then create a YTD calculation for this measure and just [YTD Apples sold (rolling)]+[Shop Sales (rolling)]. [Since Apple + Shop Sales]] already has YTD calculation within it it isn't necessary to calculate it again for the [YTD Apples sold (rolling)] part. 

In short create separate YTD calculations and + these together.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ValtteriN
Super User
Super User

Hi,

What kind of calculation are you using in your [Apple + Shop Sales]? The issue is with DATESYTD interaction with this measure so that dax should be revised.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hello! 

 

Thank you for your response

 

Please see below:

Apple + Shop Sales = CALCULATE([YTD Apples sold (rolling)]+[Shop Sales])

And Shop sales are calculated by two measures:

1. Shops calc = CALCULATE( SUM(Shop[ShopNum]),Shop[ShopName]="Shop Sales")
 
and
 
Shop Sales = IF(
    [Shops calc]=BLANK(),
    0,
    CALCULATE([Shops calc]))

Hi,

You can simplyfy the DAX a bit:

IF(

    isblank([Shops calc]),
    0,
    [Shops calc])

Then create a YTD calculation for this measure and just [YTD Apples sold (rolling)]+[Shop Sales (rolling)]. [Since Apple + Shop Sales]] already has YTD calculation within it it isn't necessary to calculate it again for the [YTD Apples sold (rolling)] part. 

In short create separate YTD calculations and + these together.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you!

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.