Forum Discussion

drinko's avatar
drinko
Helper I
4 years ago

Total for measure doing row level calculation

I am doing a labor report where I identify each employee that works a >= 20 hour shift completed on a certain date.  The Labor tables has Employee ID, Location ID, Timecard Date, Hours, Dollars and many other columns.  Joined to this is a table that maps each Location ID to a Region.  The measure below works fine when I use a Matrix report and it drills down to Employee ID.  If I drill up to Region, then it seems to count every hour of every shift instead of just the shifts that are >= 20 hours.  How do I modify my measure to work at the Region level and Employee level?

 

20+Hr Dollars = CALCULATE(sumx(Filter(Labor,SUM(Labor[Final Hours])>=20),Labor[Dollars]))

1 Reply

  • Hi,

    To your visual, drag Region from the second table to the row labels.  Write this measure:

    20+Hr Dollars = CALCULATE(sumx(Filter(Values(Labor[Employee ID]),SUM(Labor[Final Hours])>=20),Labor[Dollars]))

    If this measure does not work, then share the download link of your PBI file and show the problem very clearly.