Forum Discussion

raicardi's avatar
raicardi
Frequent Visitor
3 years ago
Solved

basic excel formula in power bi

I am trying to find a count of missing shifts. Assume 3 shifts/day, totaling 24 hours. basic excel formula below is 24 - billable hours, the next cell is /8 to get a count of how many shifts were missing. 

Post DescriptionDayBillable Hours24-c2d2/8
Mobile Patrol Unit12400
Mobile Patrol Unit22400
Mobile Patrol Unit31681
Mobile Patrol Unit42040.5
Mobile Patrol Unit51681
Mobile Patrol Unit61681
Mobile Patrol Unit71681
Mobile Patrol Unit82400
Mobile Patrol Unit925.25-1.25-0.15625
Mobile Patrol Unit101681
Mobile Patrol Unit111681
Mobile Patrol Unit121681
Mobile Patrol Unit131681
Mobile Patrol Unit141681
Mobile Patrol Unit152400
Mobile Patrol Unit162400
Mobile Patrol Unit172400
Mobile Patrol Unit182400
Mobile Patrol Unit192400
Mobile Patrol Unit202400
Mobile Patrol Unit2124.75-0.75-0.09375
Mobile Patrol Unit222400
Mobile Patrol Unit232400
Mobile Patrol Unit242400
Mobile Patrol Unit252400
Mobile Patrol Unit2623.750.250.03125
Mobile Patrol Unit272400
Mobile Patrol Unit282400
Mobile Patrol Unit292310.125
Mobile Patrol Unit301681
Mobile Patrol Unit3113111.375
  • Hi raicardi ,

    to adjust the total try this measure

    SUMX(

             VALUES(Sheet1[Work Date]),

            (24 - SUMX(Sheet1[Billable Hours])) /8

    )

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

5 Replies

  • what's the expected output? The 2 columns you showed in the sample data should be easy to get. The formula is the same as excel.

    • raicardi's avatar
      raicardi
      Frequent Visitor

      this is what is returned. The desired outcome is the same as the excel format outlined above. basically looking to see which days there were not 3 filled shifts to grab a total of how many were missing that day. 

       

    • raicardi's avatar
      raicardi
      Frequent Visitor

      this gave the desired outcome, but how do i fix the total to sum the column??

       

      • mangaus1111's avatar
        mangaus1111
        Solution Sage

        Hi raicardi ,

        to adjust the total try this measure

        SUMX(

                 VALUES(Sheet1[Work Date]),

                (24 - SUMX(Sheet1[Billable Hours])) /8

        )

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

  • Hi raicardi ,

    try to write    24 - [Billable Hours]  without any reference to the table

     

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