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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

Incorrect calculation of the previous month's value

Hello Community,

I'm trying to create values from the previous month. Everything is working as expected the only problem is that the last date in the database is April 5, 2021, but when I select the segmentation of the date range from April 1 to 4, so it gives me the correct value of the prevoius month. BUT when I select the date it ranges from April 1st to April 5th, so it gives me the total value of the equipment to the extent above.

I want you to give me value from March 1st to March 5th in my previous extension when I select the date range from April 1st to 5th.

I don't know why he's behaving like this.

Ventas anteriores = CALCULATE(SUM(DataTable[Sales]),DATEADD('Calendar'[Fecha],-1,MONTH))
Can someone help me with this?
1 REPLY 1
lbendlin
Super User
Super User

You have a couple of options here, from using EDATE(-1) rather than DATEADD(), or by adding a "Previous Month to Date"  filter.  In general the time intelligence functions go back to full periods (in your case the full previous month) unless you explicitly tell them not to.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.