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
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
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.