Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Handling Negative Entries in Data

Hello community members,

I have an Excel timesheet with data on the daily work hours of employees for different projects. I am creating a Power BI dashboard to display this information. However, some of the data contains negative values for specific days and projects, which are a result of later corrections made to the timesheet system. For example, if an employee worked 8 hours in total for a day, they may have initially reported 8 hours worked on Project X, but later corrected it to 8 hours worked on Project Y (or multiple projects), causing the original Project X hours to be recorded as negative. I need to find a way to handle/clean these negative entries so that the Power BI dashboard accurately reflects the employee's work hours.


Below is the simplified data. 

 

EmployeeProjectDateHours
Employee AProject A08-Feb-234.00
Employee AProject A08-Feb-23(4.00)
Employee AProject B08-Feb-238.00
Employee BAnnual Leave08-Feb-238.00
Employee BAnnual Leave08-Feb-23(8.00)
Employee BProject A08-Feb-236.00
Employee BProject B08-Feb-232.00

3 Replies

  • Anonymous , In power BI use a measure = Sum(Table[Hours]) , with all other column

     

    Also, you can use visual level filter measure <> 0

     

    or anew measure

     

    measure 1=

    if([Measure] =0, blank(), [Measure])

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Not sure, do you want to calculate the sum of all values with positive numbers?

    Total Hours = CALCULATE(SUM('Table'[Hours]),'Table'[Hours]>=0)

    If I misunderstand your needs, please tell me what your expected output is and how it is calculated.

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

  • Anonymous's avatar
    Anonymous
    Not applicable

    Apparently, I noticed that if I leave them as it is, the visuals automatically account for the negative values.