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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
littlemojopuppy
Community Champion
Community Champion

Date Slicer Magic! Please help!

Hi!  I've encountered something truly unusual and hoping that someone might be able to provide an explanation and how to correct for this.

 

Trying to calculate a cumulative total during the selected time period.  The formula is almost exactly what you'd expect it to be and it works correctly as shown in the screen snip below the code.

 

Contract Net Change Cumulative Total:=
VAR WeeksEnding =
    CALCULATETABLE (
        VALUES ( 'Calendar'[CalendarWeekEnd] ),
        REMOVEFILTERS ( 'Calendar'[CalendarWeekEnd] )
    )
RETURN
    CALCULATE (
        [Weekly Contract Net Change],
        FILTER (
            WeeksEnding,
            'Calendar'[CalendarWeekEnd]
                <= MAX ( 'Calendar'[CalendarWeekEnd] )
        )
    )

 

littlemojopuppy_0-1614007863529.png

 

HOWEVER if I change the date slicer from relative date to on/after date slicer, I get very different results...

littlemojopuppy_1-1614007942356.png

 

Not only is it starting at the most recent date and working backwards, it appears that the addition/subtraction is reversed!  😮😮😮

Has anyone ever encountered this?  Help?

 

1 ACCEPTED SOLUTION

Hi @AllisonKennedy I don't know if I'd call it "fixed" but I havent't been able to reproduce it and I haven't changed the formula at all.  Strangest thing I've ever seen!

View solution in original post

11 REPLIES 11
v-yingjl
Community Support
Community Support

Hi @littlemojopuppy ,

Looks like strange. I have created the same formula which data is from SSAS but could not reproduce it in my side, the formula works well whether the slicer changes or not.

slicer.png

Attached the test sample in the below.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yingjl thanks for looking at it.  It's the strangest thing I've ever seen!

parry2k
Super User
Super User

@littlemojopuppy sounds good.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k I created a sample pbix of the data model.  And when I recreated the visualization, I was unable to duplicate the issue.  Furthermore, when I went back to dig deeper into this my SSAS data model did not behave the same way - all without changing any measures or the data model (other than refreshing data).  This is very, very strange...

 

Very curious if anyone else has encountered any similar issues.

So classic case of close and restart fixed this one for now? I'll keep an eye out if I can reproduce, but haven't come across this yet to date.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hi @AllisonKennedy I don't know if I'd call it "fixed" but I havent't been able to reproduce it and I haven't changed the formula at all.  Strangest thing I've ever seen!

parry2k
Super User
Super User

@littlemojopuppy I tried on my simple data and unable to produce what you described here. Can you share pbix file to look into it? Logically it should work but as you clearly showed in your 2nd screenshot it is not doing what it is expected to do, so I would like to look at the pbix to investigate it further.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k  thank you for taking a look.

 

The actual data is in a SSAS model but I'll try to mock something up and will send.

littlemojopuppy
Community Champion
Community Champion

Hi @VijayP I don't think there's a problem with the formula.  It's that the results change depending on which kind of date slicer is used...

VijayP
Super User
Super User

@littlemojopuppy 

I wonder if you use ALLSELECTED after Filter if it would help!




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


@parry2k  @AllisonKennedy you two are really good 🙂  Any idea why the results of the formula change when the slicer is changed???

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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