March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello, I've tried a few things & scoured the boards but still can't find an answer.
The annoying thing is, I've used this formula successfully in the past but can't seem to get it to work now.
Data comes from csv exports from GA4, there are a lot of tables in the report that link to a date table [dim_date] via the date of the table. Tables are not linked together.
I export the data on a Monday for the previous week which is a Mon-Sun scenario. This data is a few weeks old so the scenario is that I exported on 27/11/23 so the previous week dates are 20/11/23 to 26/11/23.
I have a column for sessions that link to a landing page and would like to have last week and then the previous 8 weeks averaged. The dates for the 8 weeks are 25/09/23 to 19/11/23.
Onto the formulas.
There is a column that worked however a circular dependency was found once I tried to add the 8w sessions:
Solved! Go to Solution.
I managed to find the answer here: DAX Tables – Calendar and Time – Ville Gullstrands blogg (villezekeviking.com)
Using the following measures for last week, the week before & previous 8 weeks:
I managed to find the answer here: DAX Tables – Calendar and Time – Ville Gullstrands blogg (villezekeviking.com)
Using the following measures for last week, the week before & previous 8 weeks:
Hello @Anonymous,
Can you please try this:
Sessions_LW =
VAR _end = MAX(dim_date[Date])
VAR _start = _end - 6
RETURN
CALCULATE(
SUM(Landingpagemarketing[Sessions]),
FILTER(
Landingpagemarketing,
Landingpagemarketing[Date] >= _start && Landingpagemarketing[Date] <= _end
)
)
Sessions_8W =
VAR _end = MAX(dim_date[Date]) - 7
VAR _start = _end - 55 // 8 weeks minus 1 day, as _end is inclusive
RETURN
CALCULATE(
SUM(Landingpagemarketing[Sessions]),
FILTER(
Landingpagemarketing,
Landingpagemarketing[Date] >= _start && Landingpagemarketing[Date] <= _end
)
)
Average_Sessions_8W = DIVIDE([Sessions_8W],8)
Should you require any further assistance, please do not hesitate to reach out to me.
Hi @Sahir_Maharaj , I appreciate your suggestion.
I've tried the last week function & I'm returning dates in August which is definitely before last week.
I'm still having issues so any help would be appreciated. The dim_date table goes to the end of 2024 which is why (I'm guessing) the above is blank.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
90 | |
90 | |
83 | |
73 | |
49 |
User | Count |
---|---|
167 | |
149 | |
98 | |
73 | |
57 |