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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

undefined

I am calcluating the running average of my data for over three years during the winter months.   

Rolling Average Winter = AVERAGEX(FILTER(ALLSELECTED('CALENDAR'[Date].[Date]),'CALENDAR'[Date].[Date]<=MAX('CALENDAR'[Date].[Date])-1095),[Winter_Demand])
 
[Winter Demand] is the sum of the usage from between November to March.
Winter_Demand = CALCULATE(SUM(METER_READS_W[USAGE]),FILTER('ADY by Year','ADY by Year'[PremID]),FILTER(METER_READS_W,METER_READS_W[SHORTREADDATE]),OR('CALENDAR'[Month]>10,'CALENDAR'[Month]<3))
 
I need to subtract the daily usage for the summer months (by day) from the Rolling Average Winter to get the amount used in the summer which exceeds the winter usage. Any help would be appreciated.
3 REPLIES 3
v-xinruzhu-msft
Community Support
Community Support

Hi @Anonymous 

Based on your description, What are the months of summer that you would define, and it would be helpful to provide some sample data and expected results, I am a little confused that how do you want to calculate the  summer months, did it based on the measure[Rolling Average Winter ]?

 

Best Regards!

Yolo Zhu

 

 

 

Anonymous
Not applicable

THe months of March through October are a daily reading (1X day) 

THe winter months Nov-Feb are a rolling average over three years soIf I pulled July 1 2023 the rolling average would be average all data from:

2023 Jan & Feb, 2022 Nov, Dec, Jan, Feb, 2021 Nov, Dec, Jan, Feb

When I run the script I have above it comes out correct but it reports it out as a daily average instead of the average for the year.

The July 1 2023 data point is then subtracted by the Winter Running average:

July 1, 2023 = 200 cf

Winter Demand for the years in question = 100 cf

Result should be 200-100 = 100 cf.

Instead the winter demand only recognizes the winter values and will not report against the summer.

mparrish_0-1710338469013.png

So as a result the summer value July 1, 2023 has no subtraction.

Anonymous
Not applicable

The graph above is how the winter demand is printing out and as you can see there is no values for the summer. I need the winter demand to reflecct the entire year value.

Helpful resources

Announcements
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.