cancel
Showing results 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

Anonymous
Not applicable

## Struggling to create a measure

Hi everyone,

I am struggling to create a performance measure. Let's say I have a product that has to be validated by 3 different business units, I want to compute the delta time between team 1 and team 2, then between team 2 and team 3 for each of my products. The idea is then to create a matrix with every products and the time spent by the teams to validate it in order to measure efficiency.
Here's a screenshot if it can make things a bit more clear.

Does anyone have an idea how this can be done ?

1 ACCEPTED SOLUTION
Community Support

Hi @Anonymous ,

According to your description, here's my solution. Create a calculated column.

``````Column =
DATEDIFF (
MAXX (
FILTER (
'Table',
'Table'[Product] = EARLIER ( 'Table'[Product] )
&& 'Table'[Team]
= EARLIER ( 'Table'[Team] ) - 1
),
'Table'[Input_datetime]
),
'Table'[Input_datetime],
DAY
)
``````

Get the result.

I attach my sample below for reference.

Best Regards,
Community Support Team _ kalyj

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

7 REPLIES 7
Community Support

Hi @Anonymous ,

What does delta time mean, do you want to get the date difference between the previous team and current team, like this:

For team3, it should be 1 (2022/7/6-2022/7/5). For team2, it should be 0 (2022/7/5-2022/7/5). Did I understand it correctly? If not, could you please show the expected result.

Best Regards,
Community Support Team _ kalyj

Anonymous
Not applicable

Hi,

Yes, that's it !

Community Support

Hi @Anonymous ,

According to your description, here's my solution. Create a calculated column.

``````Column =
DATEDIFF (
MAXX (
FILTER (
'Table',
'Table'[Product] = EARLIER ( 'Table'[Product] )
&& 'Table'[Team]
= EARLIER ( 'Table'[Team] ) - 1
),
'Table'[Input_datetime]
),
'Table'[Input_datetime],
DAY
)
``````

Get the result.

I attach my sample below for reference.

Best Regards,
Community Support Team _ kalyj

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

Anonymous
Not applicable

Hi,
I got the following error but I don't understand why since I'm comparing 2 date values "DAX comparison operations do not support comparing values of type Text with values of type Number. Consider using the VALUE or FORMAT function to convert one of the values."

Regards,

Community Support

Hi @Anonymous ,

Is the data type of the Team column text? If so, change it to number.

Best Regards,
Community Support Team _ kalyj

Super User

@Anonymous , try a measure like

datediff([Input_datetime] , minx(filter(Table, [product] =earlier([product]) && [Team] <> earlier([Team]) && [Input_datetime] > earlier([Input_datetime] )),[Input_datetime]), day)

Anonymous
Not applicable

Thank you for your help ! However, it seems there's a problem with the measure since it's giving me inconsistent figures and most of the column values are blank