Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Syndicate_Admin
Administrator
Administrator

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.

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @Syndicate_Admin ,

I created a simple sample as below:

vkellymsft_0-1629697636482.png

Then create a measure as below:

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

And you will see:

vkellymsft_1-1629697675760.png

vkellymsft_2-1629697692884.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

 

View solution in original post

6 REPLIES 6
v-kelly-msft
Community Support
Community Support

Hi  @Syndicate_Admin ,

I created a simple sample as below:

vkellymsft_0-1629697636482.png

Then create a measure as below:

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

And you will see:

vkellymsft_1-1629697675760.png

vkellymsft_2-1629697692884.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

 

Thanks a lot!

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!

lbendlin
Super User
Super User

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

lbendlin
Super User
Super User

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

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,

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.