The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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
User | Count |
---|---|
14 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
28 | |
17 | |
11 | |
7 | |
5 |