Forum Discussion

android1's avatar
android1
Post Patron
8 years ago
Solved

Count point in time

Hi,

 

Trying to count the number of staff who started in each Week and Active = Y. I have their start date & a column which shows the last date in the week they started. Any idea how to achieve this?

  • HI android1

     

    In that case you can use this MEASURE.

     

    [Measure] is the measure we created above to count the employee each week

     

    Cumulative Count =
    SUMX (
        FILTER (
            ALLSELECTED ( TableName[Week] ),
            TableName[Week] <= SELECTEDVALUE ( TableName[Week] )
        ),
        [MEASURE]
    )

4 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    Hi android1

     

    Try this MEASURE

     

    MEASURE =
    CALCULATE ( COUNT ( TableName[Active] ), TableName[Active] = "Y" )
    • android1's avatar
      android1
      Post Patron

      That's great. Thank you.

       

      I'd like to show a running total as well. So if I was looking at week 5 id like to see total number of staff with a start date in week 5 plus the total from the previous 4 weeks.

      • Zubair_Muhammad's avatar
        Zubair_Muhammad
        Community Champion

        HI android1

         

        In that case you can use this MEASURE.

         

        [Measure] is the measure we created above to count the employee each week

         

        Cumulative Count =
        SUMX (
            FILTER (
                ALLSELECTED ( TableName[Week] ),
                TableName[Week] <= SELECTEDVALUE ( TableName[Week] )
            ),
            [MEASURE]
        )