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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
sparkplug93751
Helper II
Helper II

Rolling average of days where measure isn't 0

Hello, I have a tracker for completion by area then specific items in the area 

 

% Complete measure is ([zone x %] + [zone y % complete]+[zone z % complete])/3

 

Where zone % complete is components per zone (9 for each) then divide how many are done by the total. IE on 1/4/21 Zone X is 33.33% done (3/9 items complete)

 

 To get each piece filterable, they are tied to the second tab, a date control

 

I have a daily % complete measure as :

IF([% Complete]=1,.1,IF([% Complete]=BLANK()||[% Complete]=0,blank(),CALCULATE([% Complete],FILTER(ALL('Date Control'),'Date Control'[Date Control]=MAX('Date Control'[Date Control])))))

 

I can't share a onedrive link, sorry so here's one to google docshttps://docs.google.com/spreadsheets/d/1JBTdm2U8DeowQulto55Ofm8ohwy2vhkyLI2nH6iPXvE/edit?usp=sharing 

 

I need a 5 day rolling average where daily % complete isn't blank or 0 (ie 1/9 and 1/10). It's imperitave to let weekends be counted and not ruled out using weekday

I've tried:

 IF([% Complete]=1,.1,CALCULATE(AVERAGEX('Date Control',[daily % complete]),DATESINPERIOD('Date Control'[Date Control],LASTDATE('Date Control'[Date Control]),-5,DAY)))

 

Any help is greatly appreciated

2 REPLIES 2
amitchandak
Super User
Super User

@sparkplug93751 , So get non blank rows you can try a measure like

 

Rolling 5 = divide( CALCULATE(sum(Sales[Sales]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date]),-5,Day)) ,
CALCULATE(distinctCOUNT('Date'[Date]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-5,Day), filter(Sales,not(isblank((Sales[Sales]))))))

This average isn't dependent on dates at all just the # done vs the total #. How can I use this to work with the above measures?

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.