Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi everyone. I've got this table:
which contains only columns from my dataset.
I've grouped it by OpID by summarizing the table selecting the oldest TimeStart and the most recent TimeStop:
Now my purpose is to calculate the difference between "Prime TimeStart" (the oldest) and "Ultime TimeStop" (the most recent), by creating a measure or a calculated column. How can I do it? Here is the file: https://www.dropbox.com/s/5yurqav2acq9vlw/datediff.pbix?dl=0
Thanks!
Solved! Go to Solution.
Hi, @mtrevisiol
Try formula as below:
Diff = CALCULATE(MAX(data[TimeStop]))-CALCULATE(MIN(data[TimeStart]))
Best Regards,
Community Support Team _ Eason
if you want it per OpID
i will try calculated columns : (if you want it in minutes)
diff =
DATEDIFF([Ultime TimeStop] ), [Prime TimeStart]), MINUTE )
@Anonymous
thanks but the problem is that "Prime Time Start" and "Ultime Time Stop" are not columns. They represent the way the rows are grouped: for the oldest starttime and the most recent stoptime:
Can you group them in PowerQuery ? (instead of in the visual)
@Anonymous maybe I can duplicate the table and then modify it in PowerQuery. How do tou suggest to do it?
Hi, @mtrevisiol
Try formula as below:
Diff = CALCULATE(MAX(data[TimeStop]))-CALCULATE(MIN(data[TimeStart]))
Best Regards,
Community Support Team _ Eason
@mtrevisiol , Try measure like
sumx(values(Table[OpId]), datediff(min(Table[prime start time]), max(Table[Ultime TimeStop])))
or
calculate(sumx(values(Table[OpId]), datediff(min(Table[prime start time]), max(Table[Ultime TimeStop]))), allexcept(Table, Table[OpId]))
@amitchandak thanks but the problem is that "Prime Time Start" and "Ultime Time Stop" are not columns. They represent the way the rows are grouped: for the oldest starttime and the most recent stoptime:
User | Count |
---|---|
98 | |
75 | |
69 | |
49 | |
26 |