22 Sep 2025
07:30 AM
- last edited on
23 Sep 2025
06:13 AM
by
MaciejNeumann
Is there a way in DQL or dashboards to show the data for today and the next 7 days as 0 until we go past those days? Idea being showing each day from the Monday how many records are returned until the Sunday then the graph resets.
Eg in DQL return this table as there is only data for todays date, show 0 for the rest of the week.
Date | Count |
2025-09-22 | 254 |
2025-09-23 | 0 |
2025-09-24 | 0 |
2025-09-25 | 0 |
2025-09-26 | 0 |
2025-09-27 | 0 |
2025-09-28 | 0 |
Solved! Go to Solution.
22 Sep 2025 05:28 PM
Yes, you can just add the placeholders into your data, like this:
fetch bizevents, from: @w1
| summarize cnt=count(), by: { timestamp=timestamp@d }
| append [
data record(timestamp=array(
@w1,
@w1+1d,
@w1+2d,
@w1+3d,
@w1+4d,
@w1+5d,
@w1+6d
))
| expand timestamp
| fieldsAdd cnt=0
]
| summarize cnt=sum(cnt), by: {timestamp}
| sort timestamp asc
I am counting bizevents since beginning of week set on beginning od Monday (@w1) .
After adding placeholders I summarize again using sum(), so placeholder are deduplicates and do nothing to existing data as 0 is neutral.