Forum Discussion

KatBous's avatar
KatBous
Frequent Visitor
3 years ago
Solved

Average total calculated by weekly date

Hi to all and many thanks in advance! I have this information.  I produce a weekly report. I want to calculate by the date of each report a) how many positions were still open by each report date, ...
  • v-zhangti's avatar
    v-zhangti
    3 years ago

    Hi, KatBous 

     

    You can try the following methods.
    Measure:

    Count open =
    VAR _N1 =
        CALCULATE (
            COUNT ( 'Table'[Position Title] ),
            FILTER (
                ALL ( 'Table' ),
                [Date position opened] <= SELECTEDVALUE ( 'Report date'[Date] )
                    && [Date position closed] >= SELECTEDVALUE ( 'Report date'[Date] )
                    && [Date position closed] <> BLANK ()
            )
        )
    VAR _N2 =
        CALCULATE (
            COUNT ( 'Table'[Position Title] ),
            FILTER (
                ALL ( 'Table' ),
                [Date position closed] = BLANK ()
                    && [Date position opened] <= SELECTEDVALUE ( 'Report date'[Date] )
            )
        )
    RETURN
        _N1 + _N2
    Count closed = 
    CALCULATE (
        COUNT ( 'Table'[Position Title] ),
        FILTER (
            ALL ( 'Table' ),
            [Date position closed] <= SELECTEDVALUE ( 'Report date'[Date] )
                && [Date position closed] <> BLANK ()
        )
    )

    Is this the result you expect?

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.