Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
5 years ago
Solved

OVERTIME

Good morning

I'm doing internships at a mechanical services company, and I'm using Power BI to analyze the hours worked per mecáncio, and the overtime they do. To calculate this last I have created a very simple calculated field, since I do not have much knowledge of DAX, and the calculated field is this: EX = SUM(Parts[Hours]) - (8)

The visual I have right now is this, where I've applied different rules so that only overtime is highlighted in red, and in yellow they appear on Saturdays.Captura de pantalla (264).png

What I want to achieve is to obtain the sum of overtime worked by mechanic and that the design is much cleaner, since when I expand the data by mechanic all the work reports of all the years appear, and not only those corresponding to the selected date range, which makes it very difficult to find where that mechanic has worked every day. I only have this last problem when I add the ex calculated field, because if I only add the hours worked per day, the parts on the basis of which the sum of hours is made appear. Captura de pantalla (265).png

I would be happy to receive help and also resource recommendations to learn more about Power BI and data analytics.

Thank you very much in advance.

  • Hi  Syndicate_Admin ,

    I created a simple sample as below:

    Then create a measure as below:

    Measure =
    IF (
        ISINSCOPE ( 'Table'[Subcategory] ),
        'Table'[EX],
        SUMX ( VALUES ( 'Table'[Subcategory] ), 'Table'[EX] )
    )
    

    And you will see:

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my reply as a solution!

     

6 Replies

  • Not very clear what your actual question is. Is the slicer column connected to the rest of the data model?

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      Yes, it is connected. And the questions are how can I get the sum of overtime per worker? with the clearest possible design and what should I do to get only the work parts corresponding to the date range to appear?

      Thank you very much for your interest,

  • Please provide sample data in usable format (not as a picture - maybe insert into a table?) and show the expected outcome.

  • v-kelly-msft's avatar
    v-kelly-msft
    Community Support

    Hi  Syndicate_Admin ,

    I created a simple sample as below:

    Then create a measure as below:

    Measure =
    IF (
        ISINSCOPE ( 'Table'[Subcategory] ),
        'Table'[EX],
        SUMX ( VALUES ( 'Table'[Subcategory] ), 'Table'[EX] )
    )
    

    And you will see:

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my reply as a solution!

     

      • v-kelly-msft's avatar
        v-kelly-msft
        Community Support

        Hi  Syndicate_Admin ,

         

        Glad to help.

        If your issue is solved,could you pls mark the reply as answered to let more people find it?

         

        Best Regards,
        Kelly

        Did I answer your question? Mark my reply as a solution!