Display data in calendar weeks

How can I aggregate my data into calendar weeks? This is a simplified version of my query:

fetch events<br>| summarize count(), by:{bin(timestamp, 7d)}

This chart shows the beginning of the weeks in the legend, but I’d like to display calendar weeks:

Hi Stefan, you can achieve this with the formatTimestamp function, like so:

fetch events
| fieldsAdd week = formatTimestamp(timestamp, format: "w yyyy")
| summarize count(), by:{week}