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 !
I have a daily snapshot of sales data, i am trying to count the average of sum of sales for last 4 and 12 weeks.
Unfortunately i am ending up having a 4weeks daily average for some reason... can somebody help me sorting that issue.
in this case last 4 week average should be 688929. And due to daily snapshot i have 19.29...
Solved! Go to Solution.
Try
Last 4 weeks average =
VAR Weeks =
CALCULATETABLE (
VALUES ( 'Date'[Year-week] ),
DATESINPERIOD ( 'Date'[Date], MAX ( 'Date'[Date] ), -28, DAY )
)
VAR Result =
AVERAGEX (
Weeks,
CALCULATE ( SUM ( 'Table'[Sales] ), ALLEXCEPT ( 'Date', 'Date'[Year-week] ) )
)
RETURN
Result
Try
Last 4 weeks average =
VAR Weeks =
CALCULATETABLE (
VALUES ( 'Date'[Year-week] ),
DATESINPERIOD ( 'Date'[Date], MAX ( 'Date'[Date] ), -28, DAY )
)
VAR Result =
AVERAGEX (
Weeks,
CALCULATE ( SUM ( 'Table'[Sales] ), ALLEXCEPT ( 'Date', 'Date'[Year-week] ) )
)
RETURN
Result
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
13 | |
12 | |
10 | |
7 | |
7 |
User | Count |
---|---|
19 | |
14 | |
11 | |
10 | |
10 |