Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Count of open files

Hello,   I have a report in excel that I would like to convert to PowerBI.  I have a data set with one column of open dates and another of close dates.  I would like to create a graph, as below, wh...
  • Anonymous's avatar
    Anonymous
    7 years ago

    I just wanted to let you know I was able to get this to work using the following formula.

     

    Measure = AVERAGEX (
        VALUES ( 'tbl_DATE_INFO'[DB_DATE] ),
        VAR CurrentDate = 'tbl_DATE_INFO'[DB_DATE]
        VAR ReceivedBeforeCurrentDate =
            FILTER (
                ALL ( 'rp_all_applicants'[receive_date] ),
                rp_all_applicants[receive_date] <= CurrentDate
            )
        VAR ClosedAfterCurrentDate =
            FILTER (
                ALL ( 'rp_all_applicants'[final_action_date] ),
                rp_all_applicants[final_action_date] >= CurrentDate
            )
        RETURN
            CALCULATE (
                COUNTROWS ( rp_all_applicants ),
                ReceivedBeforeCurrentDate,
                ClosedAfterCurrentDate,
                ALL ( 'tbl_DATE_INFO' )
            )
    )