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.
Hello,
How to calculate let say sales by weeks? Now I have sum per all period. Starting weekday is Sunday.
Solved! Go to Solution.
Hi @Analitika ,
Let's assume there is a table with Date column(from 2021/1/1/ to 2022/5/20) and Value column.
If you want to calculate the sum value of each week and the starting weekday is Sunday, please firstly create a Week column using WEEKNUM()
Week = WEEKNUM([Date],1) // the second parameter is set as 1 which means the starting weekday is Sunday.
Then create a sum column or measure:
Sum by week column = CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[Week] ,'Table'[Date].[Year]))
Sum by week measure = CALCULATE(SUM('Table'[Value]),FILTER('Table',YEAR([Date])=YEAR(MAX('Table'[Date])) && [Week]=MAX('Table'[Week])))
Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Analitika ,
Let's assume there is a table with Date column(from 2021/1/1/ to 2022/5/20) and Value column.
If you want to calculate the sum value of each week and the starting weekday is Sunday, please firstly create a Week column using WEEKNUM()
Week = WEEKNUM([Date],1) // the second parameter is set as 1 which means the starting weekday is Sunday.
Then create a sum column or measure:
Sum by week column = CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[Week] ,'Table'[Date].[Year]))
Sum by week measure = CALCULATE(SUM('Table'[Value]),FILTER('Table',YEAR([Date])=YEAR(MAX('Table'[Date])) && [Week]=MAX('Table'[Week])))
Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
123 | |
78 | |
48 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |