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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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