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
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.
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.
User | Count |
---|---|
109 | |
98 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |