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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
YesP
Helper I
Helper I

Create a measure Current while filtering various month (YDT)

Hi,

I have a visualization with YTD and Same Period Last Year. I want to create a measure to get the Actuals of the last Month of the YTD. For instance: I have Data from January to Decmber 13. My filters are from January to November 2024 and my YTD (Jan-Nov) amount is $200,000 and SPLY is 180,000. I want a Current measure to show me total Sales of November. And if I change my filter from January to October I want as Current to show me total Sales of October. 

I created the following Dax but it does not works.

Last 30 days = CALCULATE([Current], DATESINPERIOD('Calendar'[Date],MAX('Calendar'[Date]),-30, DAY))

 

YesP_0-1734126584353.png

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

Measure = calculate([Current],datesbetween(Calendar[date],eomonth(max(calendar[date]),-1)+1,max(calendar[date])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

Measure = calculate([Current],datesbetween(Calendar[date],eomonth(max(calendar[date]),-1)+1,max(calendar[date])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur this works great. Thank you!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.