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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Amend DAX measure to give end of last month as opposed to start of current month

Hi Experts

How would you change the following DAX to give you end of last month - as opposed to start of current month..... see hightlight VAR

Rolling 12 till last month FEP =
VAR EndDatelastMonth = MAX('Calendar'[Date])

VAR StartDate = DATE(YEAR(EndDatelastMonth) - 1,MONTH(EndDatelastMonth),-1)

VAR Result = CALCULATE( [MONTHLY TOTAL (FEP)],
    REMOVEFILTERS('Calendar'),
    DATESBETWEEN( 'Calendar'[Date], StartDate, EndDatelastMonth ))
RETURN
Result

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Last month end date id

 

eomonth(today() ,-1)

 

eomonth(maxx(allselected('Date'),'Date'[Date])  ,-1)

 

what do you want to get there?

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Last month end date id

 

eomonth(today() ,-1)

 

eomonth(maxx(allselected('Date'),'Date'[Date])  ,-1)

 

what do you want to get there?

 

Anonymous
Not applicable

Hi Amit - I want to update my measure to give last 12 months excluding current month based on calender table....

 

STUCK

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.