# Issue with this calculate and PREVIOUSDAY

Hello everyone,

I’m having an issue with this calculate

I put a slicer in there to help me figure things out it’s not needed in fact it’s part of the problem. I’m using to select a date and getting previous date value.

Test D = CALCULATE
(
ClasseRequisitionLait[Sum Volume] example: 10 744 944
)
+ CALCULATE(VolumeLendemainParClasse[Volume Lademain par Classe]) example: 1 964 000

``````  - CALCULATE(
, **PREVIOUSDAY(VolumeLendemainParClasse[DateLivraisonPrevue]**) example: 1 902 000
)
``````

PREVIOUSDAY(VolumeLendemainParClasse[DateLivraisonPrevue]
is a slicer, when the slicer is on the date my calc
work for that day only, all the others are wrong.

If I change the date on the slicer then that calc is correct but the other
calc including the one that worked before is no longer correct.

How can I have all my calcs working … ?

I know, it’s my slicer with the PREVIOUSDAY that is causing me problems
and I don’t need the slicer. The slicer is just pointing to a date which I need
the previous date value for my calculation.
and I’m sure my calculate could be greatly improved.

Nov 11 (10 744 944 + 1 964 000) - 1 902 000 = 10 806 944

Nov 11 10 744 944 + 1 964 000 = 12 708 944 then 12 708 944 - 1 902 000 = 10 806 944

Nov 12 10 281 958 + 1 902 000 = 12 183 958 then 12 183 958 - 1 964 000 = 10 219 958

Thanks in advance to all the Pros here.

Hi @ericet.

To help us further analyze your current state and visualize your issue, could you please provide as many as you can of:

• Your work-in-progress PBIX file, using sanitized data if necessary
• Your dataset as an Excel file (again, sanitized if necessary)
• A detailed mock-up (marked-up screenshot or Excel file) of your desired outcome.

Also, if you provide DAX in your post, please fully format it using the built-in formatter.

Greg

Thank you Greg, I will see what I can do to clean up my file to the minimum where I have my problem and just the data which is not that much needed anyway to get see my problem.

Let me work on that.

As added info, I really think the calculate is the problem where I get my current date and my prior date value. Which is correct until I switch my date then the new selecting is ok but the one was correct before no longer is.

I’ll work in that and come back with my file. But maybe you would have a suggestion for my calculate ?

Thanks
Eric

Hi Greg,

Can you send me an email at ericet@mac.com please ?

I prepared a pbix file for you but I don’t want to post it publicly here.

Thanks

Eric

Hi @erict. Unfortunately no … it is one of the central purposes of this forum to share both issues and solutions, so having a record that may help others in future searches for similar issues is paramount. Please modify your PBIX or create a separate small sample PBIX such that it can be posted (and thus shared publicly) where many forum members may benefit from the analysis of the issue (perhaps using the techniques described in the above-referenced video from @BrianJ on sanitizing data).
Greg

1 Like

Yes, I totally agree.that’s why the forums are so great. Everyone benefits from the others.

I will work on my file

1 Like

Hi @ericet, did the response provided by @Greg help you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark as solution the answer that solved your query. Thanks!

Hello,

Turns out it was just a big mess, so I redesigned what I was doing and got to move forward with my project. Found a different way to move things along.

The thing that drive me a little crazy is when I see Sam do his Power BI it always looks easy, yet when I do it it’s far from being easy …

Last week I had an issue with my totals being wrong … so YouTube to the rescue. https://youtu.be/YtIdcCYnZ9w

Maybe, it’s just me having issues like this ?

But, I have other issues … but one problem at the time.

Thanks all, I will continue my Power BI programming and continue watching the Enterprise DNA teaching videos. I bought a 1 year membership in January .

Expertise is a skill that that only hard work and experience makes you gain and the path to this expertise is not always easy …

Thanks everyone

1 Like

NO! It is absolutely not just you having issues like this - we ALL still have issues exactly like this. I always laugh when somebody sheepishly posts on the forum that “they are still learning Power BI”. Even as an “Expert”, I literally still learn new things about this program every single day, much of it here on this forum. (The main thing that I think distinguishes the expert from the nonexpert is that the former has a much better grasp on how much they still don’t know…).

The videos are an excellent resource and I encourage you to watch as many of them as possible since they provide an excellent foundation on which to build upon. But the only thing that will truly make a big difference in your skill level is practice, practice and practice over an extended time period.

Your membership provides some awesome opportunities to structure that practice and get the most out of your practice time. Two that I would specifically highlight are the Enterprise DNA Data Challenges and the eDNA Problem of the Week. Information about each can be found in the videos at the top of the forum page, and people at all skill levels are encouraged to participate in both.

In addition, I put together the following video that you may find helpful, which provides a range of specific strategies to strengthen your Power BI skillset over time.

https://forum.enterprisedna.co/t/five-strategies-to-enhance-your-dax-in-power-bi/8998

Good luck in your journey, and we’re always here to help if you run into problems.

• Brian
2 Likes

Thanks for your message, I totally agree with you, experience and lot’s of practice makes you better and it’s so true.

Thank goodness for the internet and all the great Enterprise DNA learning material here.

Also, the reward of making things work is so much fun. If it would be too easy it would not be as rewarding.

All the best!

True that. Dropping a complex measure into a visual and seeing it do exactly what it’s supposed to is a rush that never gets old.

• Brian

Hello @ericet I hope that you are having a great experience using the Support Forum so far. We’ve recently launched the Enterprise DNA Forum User Experience Survey, please feel free to answer it and give your insights on how we can further improve the Support forum. Thanks!

Hi @ericet, did the response provided by @BrianJ you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark as solution the answer that solved your query. Thanks!

Hi Brian
I was looking to download the resources in your comment for practicing dax and M code. I try it but i can’t download. [ DAX and M Functions of the Day v1.1.pbix].
Thanks

Hi @ericet, we’ve noticed that no response has been received from you since the 23rd of February. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.

Happy to address this one and provide the resources, but can you please request that in a new topic so that it doesn’t get buried within an unrelated thread? This will make it easier for others to find it as well.

Thanks!

• Brian

Hi @abbi, just a friendly reminder, If you have a follow up question or concern related to a different topic than on this thread, please start a new topic. More details can be found here - Asking Questions On The Enterprise DNA Support Forum.

Hi @ericet, a response on this post has been tagged as “Solution”. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box.

We’ve recently launched the Enterprise DNA Forum User Experience Survey, please feel free to answer it and give your insights on how we can further improve the Support forum. Thanks!