Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello Power BI family,
I want to find the diiffrence in time from one ip to another when any client id is chosen. Any solution how we can reach to this query.
Solved! Go to Solution.
Hi @RIDWIV ,
Here's my solution.
1.Create a calculated column to get the rankings group by Client ID based on datetime.
Rank = RANKX(FILTER('Table',[Client ID]=EARLIER('Table'[Client ID])),[Login Date & Time],,ASC,Dense)
Then you can use DATEDIFF function to get the time intervals.
Seconds = var _pre=CALCULATE(MAX('Table'[Login Date & Time]),FILTER(ALL('Table'),[Client ID]=MAX('Table'[Client ID])&&[Rank]=MAX('Table'[Rank])-1))
var _cur=MAX('Table'[Login Date & Time])
return DATEDIFF(_pre,_cur,MINUTE)
When you use the slicer, the time interval from one IP to another in chronological order in the Client ID is displayed.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
please cross check my formula
Hi @RIDWIV ,
Here's my solution.
1.Create a calculated column to get the rankings group by Client ID based on datetime.
Rank = RANKX(FILTER('Table',[Client ID]=EARLIER('Table'[Client ID])),[Login Date & Time],,ASC,Dense)
Then you can use DATEDIFF function to get the time intervals.
Seconds = var _pre=CALCULATE(MAX('Table'[Login Date & Time]),FILTER(ALL('Table'),[Client ID]=MAX('Table'[Client ID])&&[Rank]=MAX('Table'[Rank])-1))
var _cur=MAX('Table'[Login Date & Time])
return DATEDIFF(_pre,_cur,MINUTE)
When you use the slicer, the time interval from one IP to another in chronological order in the Client ID is displayed.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
please cross check my formula
Hello @v-stephen-msft , i tried but differences in time is not coming, please let me know what else I can do
Hi @RIDWIV ,
Does your rank column return the same result as mine?
Also you can modify the measure return _pre to check if there is a problem.
Judging by the screenshot, it seems that you might have more than one table. Isn't the clientid in your formula the same as the Client ID in the slicer? Similarly, isn't the clientid of your formula the same as the Client ID in the table visual? If possible, provide your data model, i.e. your tables and columns, and the relationships between tables. Please provide virtual data to protect your privacy.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hii,
I found my mistake. I was applying formula on column intead of using measure tool. but still there is issue like i am not getting full value, please check
I have done name formatting
please send me your mail id, i will send you the table.....and rank is working same as yours
End output is not there
i mean it is not available in the table
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
25 | |
12 | |
11 | |
11 | |
8 |