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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Syndicate_Admin
Administrator
Administrator

Sales compared to the same period of the previous month

Hello to the whole community,

I have a problem. I try to fit the sales of the previous month with respect to the day of this month. That is, show the accumulated sales from 01/08 to 05/08.

I have a relationship as follows, on the one hand the sales date and a calendar table.

Captura de pantalla 2022-09-05 150426.png

I use the following formula to generate the calculation:

Cumulative Sales Previous Month =
CALCULATE (
CALCULATE (
[Sales*],
DATEADD (
FILTER (
DATESMTD ( 'Calendar Table II'[Date] ),
'Calendar Table II'[Date] <= TODAY ()
),
-1,
MONTH
)
),
FILTER ( 'Calendar Table II', 'Calendar Table II'[Date] <= TODAY () )
)
}
Captura de pantalla 2022-09-05 150935.png
I am not surprised by the result.
It should be noted that I use the same formula for other calculations and it does walk.
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

See if this measure works?

=calculate([Sales*],datesbetween('Calendar Table II'[Date],EOMONTH(TODAY(),-2)+1,EDATE(TODAY(),-1)))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @fidelp27,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

See if this measure works?

=calculate([Sales*],datesbetween('Calendar Table II'[Date],EOMONTH(TODAY(),-2)+1,EDATE(TODAY(),-1)))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
parry2k
Super User
Super User

@Syndicate_Admin I think this video on my YT channel will help (1) Learn how to compare MTD sales as of date with same number of days in previous months - Part 6 -...

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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