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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.