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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors