Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi
I need to create a measure that calculates my qty in different time periods.
The periods should relate to which yearmonth i chose in my slicer.
The periods are as follows: 0-6 month, 6-12 months, 12-24 months and >24 months
Anybody who can help me with the DAX to create this/these measures?
Solved! Go to Solution.
@Anonymous , Create these values in an independent table and handle and switch .
Measure you need are
Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-6,MONTH))
Rolling 6 to 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),-6),-6,MONTH))
Rolling 12 to 24 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),-12),-12 ,MONTH))
create slicer as we do in measure slicer
refer
How to create a Measure Slicer: https://youtu.be/b9352Vxuj-M
@Anonymous , Create these values in an independent table and handle and switch .
Measure you need are
Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-6,MONTH))
Rolling 6 to 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),-6),-6,MONTH))
Rolling 12 to 24 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),-12),-12 ,MONTH))
create slicer as we do in measure slicer
refer
How to create a Measure Slicer: https://youtu.be/b9352Vxuj-M