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
Julia_Mav
Advocate I
Advocate I

Statement for current YEAR and MONTH

Hello,
I'm using this DAX:
CurrentMonthSales = CALCULATE(SUM('SALES'[Europe]),PARALLELPERIOD('SALES'[Date],0,MONTH))
How can I modify the DAX statement to have data for the current month and YEAR (2023)?

Thanks in advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Julia_Mav , Create a measure like

 

This year Today =
var _min = eomonth(today(),-1*month(today()))+1
var _max = eomonth(_min,12 ,-1*month(today()) )
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

refer: https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27...

View solution in original post

2 REPLIES 2
Julia_Mav
Advocate I
Advocate I

Thank you @amitchandak !

amitchandak
Super User
Super User

@Julia_Mav , Create a measure like

 

This year Today =
var _min = eomonth(today(),-1*month(today()))+1
var _max = eomonth(_min,12 ,-1*month(today()) )
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

refer: https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27...

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.