cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Previous month but something is off

Hi Power BI Community!
 
I want to show the last completed month. I tried these formulars. The first comes very close but it shows not the last month at the beginning.
 
Previous month = CALCULATE([Count of delivery note], PREVIOUSMONTH(Dates[Date]))

Last months = CALCULATE(COUNT(TrackET[Delivery note])+0, DATESINPERIOD(Dates[Date2], MAX(Dates[Date2]), -1, MONTH))
 
 

 

 

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , what is the issue ? the first formula and one I am sharing should work with a date table. Marked as date Table. Make sure Date table is Marked as date Table

 

 

Previous month = CALCULATE([Count of delivery note] , PREVIOUSMONTH(Dates[Date]))

 

last MTD (complete) Sales = CALCULATE(SUM([Count of delivery note] ,DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , what is the issue ? the first formula and one I am sharing should work with a date table. Marked as date Table. Make sure Date table is Marked as date Table

 

 

Previous month = CALCULATE([Count of delivery note] , PREVIOUSMONTH(Dates[Date]))

 

last MTD (complete) Sales = CALCULATE(SUM([Count of delivery note] ,DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))

Anonymous
Not applicable

Thanks now it works!

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.