The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi All,
I have a query as i have a table where i wish to create a difference between the same serial number's first Work order closed and second Work order opened date as Days Diff so that i can find out when the next work order was created after the previous one was closed . Please support . Below is the list of details. i have lots of serial numbers and Work order none in a sequence but randoms.
Solved! Go to Solution.
Hi @SAU1111 ,
Please add an index column in Power Query:
Then please try following DAX:
Days difference =
var cur_index = 'Table'[Index]
var pre_index = cur_index+1
var diffe = CALCULATE(
MAX('Table'[CreateDate]),
FILTER('Table','Table'[Index] = pre_index && 'Table'[Serial Number] = EARLIER('Table'[Serial Number])))
return
DATEDIFF([ClosedOn],diffe,DAY)
If I misunderstand your demands, please feel free to contact us in time.
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @SAU1111 ,
Please add an index column in Power Query:
Then please try following DAX:
Days difference =
var cur_index = 'Table'[Index]
var pre_index = cur_index+1
var diffe = CALCULATE(
MAX('Table'[CreateDate]),
FILTER('Table','Table'[Index] = pre_index && 'Table'[Serial Number] = EARLIER('Table'[Serial Number])))
return
DATEDIFF([ClosedOn],diffe,DAY)
If I misunderstand your demands, please feel free to contact us in time.
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@SAU1111 , a new column
Datediff( [Close Date], Minx(filter(Table, [Serial Number]= earlier([Searial Number]) && [Open Date] > earlier([Close date]) ) , [Open Date]) , Day)
or
Datediff( [Close Date], Minx(filter(Table, [Serial Number]= earlier([Searial Number]) && [Open Date] > earlier([Open date]) ) , [Open Date]) , Day)
I think its not working could you confirm :
User | Count |
---|---|
68 | |
63 | |
59 | |
54 | |
28 |
User | Count |
---|---|
181 | |
82 | |
63 | |
47 | |
43 |