Forum Discussion
DAX measure with dynamic input
Hi fabiomanniti ,
You can refer the following links to get it.
Try this measure
=calculate([qty_sales],datesbetween(calendario[date_key],EOMONTH(MAXX(ALL(calendario),calendario[date_key]),-6)+1),MAX(calendario[date_key])))
To your visual, drag Year and Month from the calendario table. Ensure the actual date columns of your data table and calendario table are related.
Calculate the values of the 1, 3 and 6 months prior to the current one
assuming you have date table and marked as date, you can use following measure to calculation L12 month and change this measure for 3 and 6 months
Last 12 Months = VAR __lastMonthDate = EOMONTH ( TODAY(), -1 ) VAR __numberofMonth = 12 RETURN CALCULATE ( SUM ( Table[Sales] ) , DATESINPERIOD ( Calendar[Date], __lastMonthDate, -__numberofMonth, MONTH ) )
Best Regards
This was exactly what I had been searching for - I was needing to filter results 'on the fly' depending upon a user-selected week ending date. I ended up using DATESBETWEEN for the clustered column field and a different range of DATESBETWEEN for the associated line chart.