Forum Discussion

joshcomputer1's avatar
8 years ago
Solved

Get a Count from Measure

I have a  table of employees and we keep track of attendance points.  The points are accumulated from the last 6 months so I have a measure that sums those [Last6MonthPoints].  Based on that total, I...
  • joshcomputer1's avatar
    joshcomputer1
    8 years ago

    I ended up changing my query quite a bit to get a total per employee per month. Then I added a calculated column to get the sum of points from the last 5 months (including this month).  After getting this calc'ed column, I just added another column for the attendance standing i.e. good standing, step 1, etc....When I use this status column, I can now slice and filter by it. 

     

    Points 6 Month Total = calculate(sum(tblLeaveMaster[PointTotal]),
    Allexcept( tblleavemaster, tblLeaveMaster[Employee Name]),
              DATESBETWEEN(
                     tblLeaveMaster[Date],
                    Dateadd(lastdate(tblLeaveMaster[Date]), -4, Month),
                  //Four Month Ago
                   LastDate(tblLeaveMaster[Date])
               )
    )