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

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.