Latest Enterprise DNA Initiatives

DAX worked hours since admission date

Hey guys,
i have this measure that allow me to have the total of hours that were due to work, by each employee:

T Hr Due =
CALCULATE (
( COUNT ( ‘Tab Dates’[Date] ) * 8 )
* DISTINCTCOUNT ( ‘Tab TimeSheet’[Employee ™] ),
FILTER ( ‘Tab Dates’, ‘Tab Dates’[Day Type] = “Weekday” )
)

Now i have to show these hours but accordingly to their admission date. Which means it only counts from their admission date.
I thought i could add to the filter line something like this:

T Hr Due =
CALCULATE (
( COUNT ( ‘Tab Dates’[Date] ) * 8 )
* DISTINCTCOUNT ( ‘Tab TimeSheet’[Employee ™] ),
FILTER ( ‘Tab Dates’, ‘Tab Dates’[Day Type] = “Weekday” && ‘Tab Dates’[Date] >= [Admission Date] )
)

But it can’t be done like this.
Can anyone of you guys help me out here?
Thanks a lot
Pedro

1 Like

Hi Pedro,

I think you should add another filter instead of using &&.

Can you try:

FILTER( ‘Tab Dates’, ‘Tab Dates’[Day Type] = “Weekday"),
FILTER( **‘Tab Dates’[Date] >= [Admission Date])

Hi @Rens
Maybe you’re right but it seems i can’t add the column Admission_date to the filter because it asks an expression

Pedro,

There might have been a typo in my answer. I didn’t add the table name in the 2nd filter. I hope this works!

FILTER( ‘Tab Dates’, ‘Tab Dates’[Day Type] = “Weekday"),
FILTER("Tab Dates’, ‘Tab Dates’[Date] >= [Admission Date])

yes but i did understand what you meant and i’ve add it.
The problem is that it expects an expression and i can’t write a column or a measure like you have after the “>=” sign

That is weird…
I still have the old .pbix file that you posted on a previous query and I pasted in this measure and it works:

T Hr Due =

CALCULATE (

( COUNT ( ‘Tab Dates’[Date] ) ),

FILTER ( ‘Tab Dates’, ‘Tab Dates’[Day Type] <> “Weekday” ), FILTER(‘Tab Dates’, ‘Tab Dates’[Day Type] <> ‘Measures Employees’[Measure])

)

I also created a Measure named Measure : [Measure] = “abc”

Great then!
If you have the old file you’ll be able to help me but let me say first, the measure for T Hr Due, is the one above on my first measure. You just have to change it, please.
Can you now please try to add that filter that you’ve mentioned? The column is data_admissao and the table is Tab Business Leader.

There is no Timesheet table in the file I have.
Can you upload the most recent file?

You mentioned that after the >= there was an issue. Also try to add the table in front of the measure:
So ‘Measures Employees’[Measure] instead of [Measure]

Sure.
Thanks a lot

1 Like

I don’t see it!

Hi Pedro, I am sorry but I do not find a solution for this one.

I hope somebody else can assist!