Forum Discussion
Anonymous
6 years agoNot applicable
First time fix
Hello, I am new to PowerBI and I'd like to ask for a help with creating the following DAX function. Data set example: Installation number Service ticket number ST date created ...
Anonymous
6 years agoNot applicable
I should add, that if a service ticket was closed in say May this year, but no new service ticket was created until today, then that ticket should also be counted as First time Fixed.
Thanks, Lena
- Anonymous6 years agoNot applicable
Thank you very much Lin, it works great on a row level. However, the measure is formatted as text, (I have changed 'First time fix =1, and 'No" =0) to make it countable, I also added +0 at the end of the measure to be able to format it as whole number. I still am unable to sum up the results, and total appears as 1. Can you please help me to modify it so that I can get totals for specific time frames? I need to measure this KPI every month.
Thank you,
Lena
First time fix =VAR nextcreatedate =CALCULATE (MIN ( Services[Date Created] ),FILTER (ALLSELECTED ( 'Services' ),'Services'[Installation] = MAX ( 'Services'[Installation] )&& MAX ('Services'[Date Closed] ) < 'Services'[Date Created]))RETURNVAR days =IF (nextcreatedate = BLANK (),DATEDIFF ( MAX ( 'Services'[Date Closed] ), TODAY (), DAY ),DATEDIFF ( MAX ( 'Services'[Date Closed] ), nextcreatedate, DAY ))RETURNIF ( days >= 90, "1", "0" )+0