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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Previous Month From Selected Month

Hello Power Bi 🙂

 

Could you please assist me in writing a DAX function that represents the number of tickets that were carried over from previous months? For example, if I choose the month from a date slicer to be March, I need this measure to count the number of tickets created before 1st February 2022. So, I need the 1st day of the previous month to the month I select, not the month of today’s date.

 

I set it up as per below, but every time I need to manually modify the date in purple below in the CarriedOverColumn. I need it to work automatically. Thanks in advance!

 
 
CarriedOverColumn = IF('All Tickets'[Created Time] < DATE(2022,02,01) ,"YES","NO")
 
 
CarriedOver =
var _carriedover = CALCULATE(
COUNTROWS ('All Tickets'),

 

FILTER ('All Tickets','All Tickets'[Request Status] IN {"Open","Awaiting Customer Feedback", "Scheduled", "Awaiting Third Party Feedback", "Onhold", "Stable", "Requires Purchase"}),

 

FILTER('All Tickets','All Tickets'[CarriedOverColumn] IN {"YES"}),

 

FILTER ('All Tickets','All Tickets'[Priority] IN {"User P1","User P2","User P3","Core P1","Core P2","Core P3"})
)
return IF(ISBLANK(_carriedover),0,_carriedover)
 
 
Best Regards,
Deema
 
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

you can get the first day of last month with  EOMONTH( TODAY(), -2) + 1

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

you can get the first day of last month with  EOMONTH( TODAY(), -2) + 1

Anonymous
Not applicable

Thank you johnt75. I tried this function however it reads data based on "today". I need it to subtract the month from the month I choose in the date slicer. So if I'm running the report of March, it should give me anything before Feberuary.

When I did this using the function "today", it shows anything before March not February.

Replace TODAY() with MAX('Date'[Date])

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.