Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All,
Please note that I am able to get the Last 7 days rolling Average for the below chart by Using the following Dax
In this case, the Last 7 Days' AVG should be about 350/7,350/6,... so on
So how can I solve this?
Hoping for your support Guys...
Thanking a lot
Faithfully,
Rifdhy (+94770848216)
Solved! Go to Solution.
Hi @Anonymous
How about try these measures
7 Days Moving SUM. =
CALCULATE (
[Total Fuel Consumed],
ALL ( 'Calendar'[Date] ),
DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), -7, DAY )
)
# of Days =
CALCULATE (
DISTINCTCOUNT ( 'Calendar'[Date] ),
ALL ( 'Calendar'[Date] ),
DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), -7, DAY )
)
Last 7 Days AVG = DIVIDE ( [7 Days Moving SUM.] + 0, [# of Days] )
In addition, did you use 'Calendar'[Date] column on X-axis in the visual? It is expected there.
----------------------------------------------------------------------
If this reply helps solve the problem, please mark it as Solution! Kudos are appreciated too!
Hi @Anonymous
How about try these measures
7 Days Moving SUM. =
CALCULATE (
[Total Fuel Consumed],
ALL ( 'Calendar'[Date] ),
DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), -7, DAY )
)
# of Days =
CALCULATE (
DISTINCTCOUNT ( 'Calendar'[Date] ),
ALL ( 'Calendar'[Date] ),
DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), -7, DAY )
)
Last 7 Days AVG = DIVIDE ( [7 Days Moving SUM.] + 0, [# of Days] )
In addition, did you use 'Calendar'[Date] column on X-axis in the visual? It is expected there.
----------------------------------------------------------------------
If this reply helps solve the problem, please mark it as Solution! Kudos are appreciated too!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.