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.
How can I get value for MAX timestamp and MIN timestamp in Table 1 from Table 2 as per below scenerio-
Solved! Go to Solution.
@learner03 apologies, I didn't catch that requirement in your initial description.
How about these:
MIN Timestamp =
VAR _USERNAME = Table1[UserName]
VAR _DATE = FORMAT(Table1[Date], "dd/mm/yyyy")
VAR _Result =
CALCULATE(
MIN(Table2[Timestamp]),
Table2[User] = _USERNAME,
FORMAT(Table2[Timestamp], "dd/mm/yyyy") = _DATE
)
Return
_Result
MAX Timestamp =
VAR _USERNAME = Table1[UserName]
VAR _DATE = FORMAT(Table1[Date], "dd/mm/yyyy")
VAR _Result =
CALCULATE(
MAX(Table2[Timestamp]),
Table2[User] = _USERNAME,
FORMAT(Table2[Timestamp], "dd/mm/yyyy") = _DATE
)
Return
_Result
@learner03 assuming you are trying to do this as a calculated column in Table 1, you could use something like:
MIN Timestamp =
VAR _USERNAME = Table1[UserName]
RETURN
CALCULATE(
MIN(Table2[Timestamp]),
Table2[User] = _USERNAME
)
and
MAX Timestamp =
VAR _USERNAME = Table1[UserName]
RETURN
CALCULATE(
MAX(Table2[Timestamp]),
Table2[User] = _USERNAME
)
Thanks . Just a follow up Question--
How can I get difference of the Start and end time in hours (like whole number example 5,6.5 etc)-
I tried with this, but getting minimum time from whole Table 2 and Max time from whole Table 2 like below-
where as I want min time of 21/07/201 and Max time of 21/07/201, and similarly min time of 22/07 amd max time of 22/07 and so on . So, basically min and max time of the date.
@learner03 apologies, I didn't catch that requirement in your initial description.
How about these:
MIN Timestamp =
VAR _USERNAME = Table1[UserName]
VAR _DATE = FORMAT(Table1[Date], "dd/mm/yyyy")
VAR _Result =
CALCULATE(
MIN(Table2[Timestamp]),
Table2[User] = _USERNAME,
FORMAT(Table2[Timestamp], "dd/mm/yyyy") = _DATE
)
Return
_Result
MAX Timestamp =
VAR _USERNAME = Table1[UserName]
VAR _DATE = FORMAT(Table1[Date], "dd/mm/yyyy")
VAR _Result =
CALCULATE(
MAX(Table2[Timestamp]),
Table2[User] = _USERNAME,
FORMAT(Table2[Timestamp], "dd/mm/yyyy") = _DATE
)
Return
_Result
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
106 | |
75 | |
44 | |
39 | |
33 |
User | Count |
---|---|
165 | |
90 | |
65 | |
46 | |
43 |