Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I'm currently trying to modify a formula to show only past 4 weeks of sales. Currently, the formula shows average unit sales for all selected weeks in the dashboard.
This is the current formula:
Solved! Go to Solution.
First: Do you have a contiguous Date dimension attached to your fact table. Let's assume you do.
Create a calculated column in the Date table of [Weeks Back] = DATEDIFF(WEEK, 'Date'[Date], TODAY() )
NOTE: Not sure if the DAX is 100% accurate here, going from memory.
Now create your measure:
Last Four Weeks Sales = CALCULATE ( SUM ( <some column> ), 'Date'[Weeks Back] IN {1, 2, 3, 4} )
Proud to be a Super User! | |
First: Do you have a contiguous Date dimension attached to your fact table. Let's assume you do.
Create a calculated column in the Date table of [Weeks Back] = DATEDIFF(WEEK, 'Date'[Date], TODAY() )
NOTE: Not sure if the DAX is 100% accurate here, going from memory.
Now create your measure:
Last Four Weeks Sales = CALCULATE ( SUM ( <some column> ), 'Date'[Weeks Back] IN {1, 2, 3, 4} )
Proud to be a Super User! | |
User | Count |
---|---|
98 | |
89 | |
82 | |
71 | |
67 |
User | Count |
---|---|
114 | |
104 | |
101 | |
72 | |
65 |