Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
Hi there! 🙂
I would like to calculate the average of the results of a cumulative measure that is called Quantity Cumulative. The idea is to retrieve the results of that measure from the last 90 days. So for each of those 90 days I need to retrieve the result of that Quantity Cumulative measure. The next step that needs to be taken, is to take the average of those 90 values.
This is what the Quantity Cumulative measure looks like:
I've been racking my brain for hours, but I can't seem to figure it out. I've tried multiple measures that include CALCULATE, DATESINPERIOD, AVERAGEX, etc., but nothing seems to work. A couple of examples of the measures I tried:
Any help is highly appreciated!
Solved! Go to Solution.
@TessBroersen , Make sure Dim_Calendar is marked as date table and in visual period from Dim_Calendar is used
Try
CALCULATE (
AVERAGEX ( VALUES ( Dim_Calendar[DateValue_Date] ), CALCULATE ([Quantity], filter(all(Dim_Calendar), Dim_Calendar[DateValue_Date] <= max(Dim_Calendar[DateValue_Date]) ))),
DATESINPERIOD ( Dim_Calendar[DateValue_Date], MAX ( Dim_Calendar[DateValue_Date] ), -90, DAY )
)
cumm = CALCULATE ([Quantity], filter(all(Dim_Calendar), Dim_Calendar[DateValue_Date] <= max(Dim_Calendar[DateValue_Date]) ) )
agv=
CALCULATE (
AVERAGEX ( VALUES ( Dim_Calendar[DateValue_Date] ), [Cumm]),
DATESINPERIOD ( Dim_Calendar[DateValue_Date], MAX ( Dim_Calendar[DateValue_Date] ), -90, DAY )
)
Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Thanks for your help, it worked 🙂
The only thing that keeps surprising is me is that the two options you showed me, both have very different outcomes...
The second option was the one that worked for me, so thanks a lot!
Hi Amitchandak,
Thanks for your reply!
You've sent me three DAX-measures. The first one results in different numbers than the second one combined with the third.
The measures I've tried before resulted in the same numbers however.
I still have no idea what numbers are the correct ones to be honest. Your first option results in higher numbers for some Article Numbers, but for other Article Numbers it results in the exact same numbers as your third option does.
@TessBroersen , Make sure Dim_Calendar is marked as date table and in visual period from Dim_Calendar is used
Try
CALCULATE (
AVERAGEX ( VALUES ( Dim_Calendar[DateValue_Date] ), CALCULATE ([Quantity], filter(all(Dim_Calendar), Dim_Calendar[DateValue_Date] <= max(Dim_Calendar[DateValue_Date]) ))),
DATESINPERIOD ( Dim_Calendar[DateValue_Date], MAX ( Dim_Calendar[DateValue_Date] ), -90, DAY )
)
cumm = CALCULATE ([Quantity], filter(all(Dim_Calendar), Dim_Calendar[DateValue_Date] <= max(Dim_Calendar[DateValue_Date]) ) )
agv=
CALCULATE (
AVERAGEX ( VALUES ( Dim_Calendar[DateValue_Date] ), [Cumm]),
DATESINPERIOD ( Dim_Calendar[DateValue_Date], MAX ( Dim_Calendar[DateValue_Date] ), -90, DAY )
)
Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
21 | |
15 | |
15 | |
11 | |
7 |
User | Count |
---|---|
25 | |
24 | |
12 | |
12 | |
11 |