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
Winner of T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Find out who won the T-Shirt Design Challenge and the top 3 finalists.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

Top Solution Authors