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
Anonymous
Not applicable

Average open time for reports open a given month

OK, this question might be a bit "Hairy", but here goes:

 

I have a Sharepoint List used as a Non-conformity database.

 

For each Non-conformity Report, I have a Created date 'NCR'[Created], a Closed Date 'NCR'[NCRFinalDate] and a 'NCR'[Now] column showing today's date.

Now for the hairy bit: I need to know the average "Age" (time from [Created] to End-of-Month) for all open NCRs ( 'NCR'[Created] < End-of-Month AND 'NCR'[NCRFinalDate] > End-of-Month) for each month in my data-set, which starts Sept-2017.

 

I use this Measure to get the number of open NCRs in a given month:

# of open NCR per Month =
VAR _Day =
EOMONTH ( MAX ( 'Month'[Month] ), 0 )
RETURN
COUNTROWS (
FILTER (
ALL ( 'NCR' ),
'NCR'[Created] <= _Day
&& 'NCR'[NCRFinalDate] > _Day
)
)
 
Can something similar be used for this task?
 
/Jens
1 ACCEPTED SOLUTION

In the last line replace 'NCR'[NCR Final Date] with _Day

View solution in original post

4 REPLIES 4
johnt75
Super User
Super User

Yes, you can replace the COUNTROWS with AVERAGEX

Average duration =
VAR _Day =
    EOMONTH ( MAX ( 'Month'[Month] ), 0 )
RETURN
    AVERAGEX (
        FILTER ( ALL ( 'NCR' ), 'NCR'[Created] <= _Day && 'NCR'[NCRFinalDate] > _Day ),
        'NCR'[NCRFinalDate] - 'NCR'[Created]
    )
Anonymous
Not applicable

Hi John!

 

Thank you for your answer, your solution does gives the wrong result, however, as the "Age" of the NCRs in a given month is (End-of-month - 'NCR'[Created]), not ('NCR'[FinalDate] - 'NCR'[Created]).

 

Any way of getting an End-of-month in there?

 

/Jens

In the last line replace 'NCR'[NCR Final Date] with _Day

Anonymous
Not applicable

Thanks!

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.

Top Solution Authors