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 would like to compare my weekly and monthly sales with the previous week or month. How can I do it?
Imagine my data source looks like this
And my final goal is to be able to build a matrix like this
How can I do this?
Last. How can I compare versus a same week or same month last year?
Solved! Go to Solution.
Hi @Anonymous ,
You can create calendar table first of all, create relationship between your data table and calendar table on date field, then create measures like DAX below. You can create for Month sale in the similar template (see the red mark).
DateDim= CALENDARAUTO() CW Sale= CALCULATE(SUM(Table1[sales]),FILTER(ALLSELECTED(Table1),YAER(Table1[Date]) =YEAR(MAX(Table1[Date]))&&Table1[WeekNum] =MAX(Table1[WeekNum]))) LW Sale = CALCULATE(SUM(Table1[Sales]),DATEADD('DateDim'[Date],-7,DAY)) Vs LW %= IF([LW]<>BLANK(),DIVIDE([CW]-[LW],[LW]),BLANK())
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.
Best regards
Amy
Hi @Anonymous ,
You can create calendar table first of all, create relationship between your data table and calendar table on date field, then create measures like DAX below. You can create for Month sale in the similar template (see the red mark).
DateDim= CALENDARAUTO() CW Sale= CALCULATE(SUM(Table1[sales]),FILTER(ALLSELECTED(Table1),YAER(Table1[Date]) =YEAR(MAX(Table1[Date]))&&Table1[WeekNum] =MAX(Table1[WeekNum]))) LW Sale = CALCULATE(SUM(Table1[Sales]),DATEADD('DateDim'[Date],-7,DAY)) Vs LW %= IF([LW]<>BLANK(),DIVIDE([CW]-[LW],[LW]),BLANK())
Best Regards,
Amy
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 |
---|---|
101 | |
66 | |
48 | |
39 | |
34 |
User | Count |
---|---|
166 | |
112 | |
60 | |
56 | |
37 |