I am looking to create a visual which displays data from the previous week up until the current time.
For example, if today is Wednesday at 11am, I would like to see my data from last week for
Monday full day, Tuesday full day, Wednesday until 11am.
Currently, the previous week formula I am using looks at the full day for Wednesday, therefore it is not a like for like comparison (we are measuring footfall).
How the DAX is set up at the moment:
The current week is a simple SUM() calculation
The previous week is CALCULATE( [Current Week], DATEADD ( āDateā[Date], -7, DAY )
I believe the week to date calculation is almost what I am after, however I canāt tell whether this format also looks at the current time in the day, rather than just the date?
So essentially, I would be after āweek to current date and timeā, so I can see the previous week, up to the current time.
Hope this makes sense - and thanks again for your help!
@Clolawra
In the Measure you could go
Total FootfallUntil current time =
VAR CurrentTime = NOW()
VAR CurrentTimeLastWeek = CurrentTime - 7
VAR Result = CLACULATE(
[Total Footfall],
count_measurement_feed[date_from] +count_measurement_feed[time] <= CurrentTimeLastWeek
)
RETURN
Result
I suspect the issue maybe where you are adding the date and time column
I would suggest you check what count_measurement_feed[date_from] +count_measurement_feed[time] gives you by adding a calculated column temporarily.
Hi @ells and @jafernandezpuga - thanks so much for this!
I wonāt get chance to look into this now until Monday so please leave it with me and I will get back to you as soon as I can
I have tried both these solutions and it appears to be working as expected!
Thanks so much for taking your time to look into this for me, Iāve noted the formulas down for future reference for when I forget in a few months time