DAX formula not working

Hi there,

I am trying to display all workers with work hours greater than 40 per week but my formula seems to miss the mark. I’ll use this formula, when correct, to do a few other calculations, so this has to be in DAX.

Hope you can help.

Thank you!
Mnet_1.zip (80.3 KB)

@powerbideveloper,

Check out this post - it’s focused on identifying all workers < 40 hours week, but the DAX should be easily modifiable to fit your opposite situation.

  • Brian
1 Like

Just a quick note - please add all details of the issue you are experience in the forum post.

Please see here for more details

Thanks
Sam

1 Like

Awesome, Brian!

I had looked at this example before but because you knew it would help, that pushed me to try the one formula in the example I did not try myself, and I can now see what I was missing:

Test = IF( data[Hrs > 40] > 40, [Hrs > 40], BLANK() )

Thanks again!!

@powerbideveloper,

Great – glad to hear that worked well for you.

– Brian

Hi Brian,

A quick question to understand your example more fully. Why do you have the Total Hrs Employee by Week Measure, when the Total Hrs Employee by Week < 40 Measure works fine with just the Total Hours Measure since you use both the Name and Week Number in the visual?

Thank you!

@powerbideveloper,

Nice catch. The honest answer is that initially when I started working on a solution to this, I thought the additional iteration would be necessary and once I found a solution that worked I didn’t go back and optimize the DAX code to take out the unnecessary iteration. It does no harm (although in a big data set it would exact a performance hit), but you’re absolutely right that the visual provides sufficient evaluation/filter context to allow use of the simpler [Total Hours] measure.

  • Brian