Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mowehr
New Member

Rolling average per time and not by date

Hi, nothing I tried or looked at helped so far.

 

I have the following data which shows the occupancy of three institutions:

"ID", "Vorgang" (entries and exits as text), "Datum Uhrzeit" (date & time) and "Betrieb" (institution).

 

I created additional columns: "Zeit" (time from timestamp), "Vorgang Zahl" (entries and exits as numbers; 1 or -1 --> meaning a person enters or leaves the building), "Schicht" (values: early and late shift, because the institutions each have early AND late shifts), "Wochentag" (numeric weekday, Sunday = 1).

 

Then I have the following measures: "Summe Vorgang Zahl" (sum of the column "Vorgang Zahl") and "Laufende Summe Vorgang Zahl" (running total of the measure "Summe Vorgang Zahl"):

Laufende Summe Vorgang Zahl =
CALCULATE(
    [Summe Vorgang Zahl],
    FILTER(
        ALLSELECTED('Table 1'[Zeit]),
        ISONORAFTER('Table 1'[Zeit], MAX('Table 1'[Zeit]), DESC)
    )
)

With "Laufende Summe Vorgang Zahl" I can display the occupancy of the three institutions by means of a line chart and limit the period by means of a date filter.

mowehr_0-1690459674303.png

(Image: what a day looks like)

What I am now missing are the average occupancy figures, so that I can also correctly display periods that are longer than one day. The ratios in the line chart are correct with the running total, but the (agreggated) values are not meaningful. What formula do I need to use for the average occupancy numbers so that I can use them in a line chart for any given date range that is set by the date filter: x-axis "time", y-axis new measure, legend = instutions, filter = date. 

 

The quickmeasure rolling average, and any derivation of that I tried, won't allow for the use of time in the chart as it calls for a date hierarchy. I have a date hierarchy but the smallest value are dates and not times.

0 REPLIES 0

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.