Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hey all,
Looking for some help in comparing the last 30 days to the previous 30 day period.
I've got an export of Google Search Console data which is loaded into one table.
I've summarised the date range 1/3/2022 - 30/3/2022 (last 30 days) into a table.
To highlight the DAX used to summarize the clicks, I used.
last 30 day clicks =
CALCULATE (
SUM ( mytable[clicks] ),
DATESINPERIOD ( date_lookup[date], MAX ( date_lookup[date] ), -30, DAY )
)
I then went through the same process to summerize total impressions, av pos and keyword count.
What I'm struggling with is how to write the DAX which takes the previous 30 day period (30/1/2022 - 28/2/2022).
Hope this makes sense as to what it is I'm trying to achieve.
Thanks,
Solved! Go to Solution.
@stuhoughton , Last 30 before 30
last 30 day before 30 clicks =
CALCULATE (
SUM ( mytable[clicks] ),
DATESINPERIOD ( date_lookup[date], MAX ( date_lookup[date] ) -30 , -30, DAY )
)
make sure date_lookup is marked as date table
Hey @amitchandak thanks for the super quick response.
Yeah that works perfectly. I'm still learning the basics really appreicate your help. 😊
@stuhoughton , Last 30 before 30
last 30 day before 30 clicks =
CALCULATE (
SUM ( mytable[clicks] ),
DATESINPERIOD ( date_lookup[date], MAX ( date_lookup[date] ) -30 , -30, DAY )
)
make sure date_lookup is marked as date table
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |