Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I have a process that returns several date/time values for tha same control number. For example:
row number date/time
1 1234 24/08/2020 10:12
2 1234 24/08/2020 11:25
3 1234 24/08/2020 11:48
4 1234 24/08/2020 12:36
I need a measure that recognizes the oldest and the econd oldest value for the same control number and calculate the diferrence between then. In this case they are in the rows number 1 (oldest) and 2 (second oldest) and the diference is 01:13 (it can be in minutes too, 01:13 = 73 minutes).
Solved! Go to Solution.
@Anonymous
Please try this
Measure =
VAR _MIN=MIN('Table'[date/time])
VAR _SECMIN=MINX(FILTER('Table','Table'[date/time]>_MIN),'Table'[date/time])
RETURN DATEDIFF(_MIN,_SECMIN,MINUTE)
Proud to be a Super User!
@Anonymous
Try this measure please:
Difference =
VAR _MIN =
CALCULATE(
MIN(CONTROL[Date]),
ALLEXCEPT(CONTROL,CONTROL[Number])
)
VAR _MIN2 =
CALCULATE(
MIN(CONTROL[Date]),
CONTROL[Date] > _MIN,
ALLEXCEPT(CONTROL,CONTROL[Number]))
RETURN
DATEDIFF(
_MIN,
_MIN2,
MINUTE
)
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Anonymous
Please try this
Measure =
VAR _MIN=MIN('Table'[date/time])
VAR _SECMIN=MINX(FILTER('Table','Table'[date/time]>_MIN),'Table'[date/time])
RETURN DATEDIFF(_MIN,_SECMIN,MINUTE)
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
87 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |