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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a Date/Time for each action a person takes, but there are multiple people each with their own actions. How would I find the datediff between each record by person/date? Columns:
Date/Time | ActionType | AgentID (person)
Solved! Go to Solution.
Hi @bhmiller89 ,
I created an sample as your requested, column date/time and clientID:
You can get the datediff using below measure: (you can change the datediff function as Second/Hour/Minute)
Measure = var a = CALCULATE(MIN([DateTime]),ALLEXCEPT('Table (2)','Table (2)'[ClientID]))
var b = CALCULATE(MAX([DateTime]),ALLEXCEPT('Table (2)','Table (2)'[ClientID]))
Return
DATEDIFF(a,b,DAY)
Hi!
Could you post two or three rows in your columns (with fake data) to clarify to problem a bit more? Not sure I quite understand your problem.
Hi @bhmiller89 ,
I created an sample as your requested, column date/time and clientID:
You can get the datediff using below measure: (you can change the datediff function as Second/Hour/Minute)
Measure = var a = CALCULATE(MIN([DateTime]),ALLEXCEPT('Table (2)','Table (2)'[ClientID]))
var b = CALCULATE(MAX([DateTime]),ALLEXCEPT('Table (2)','Table (2)'[ClientID]))
Return
DATEDIFF(a,b,DAY)
Hi @bhmiller89 ,
Please correct me if I go wrong.
you'd like to calculate the datediff by same AgentID but different action, that it comparing the adjacent rows in date column. right?
It's preferred to share us your dummy pbix, that would be easier for us to provide the valuable advice.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 39 | |
| 37 | |
| 29 | |
| 24 |
| User | Count |
|---|---|
| 119 | |
| 100 | |
| 72 | |
| 69 | |
| 65 |