Forum Discussion

YesP's avatar
YesP
Icon for Helper I rankHelper I
1 year ago
Solved

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

 

 

  • Hi,

    Try this measure

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

    Hope this helps.

3 Replies

  • Hi,

    Try this measure

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

    Hope this helps.