Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
I need to manage some date.
I need to calculate the difference (in terms o number days) among dates.
so, I have for each costumer the date related to each transaction they make and I need to know how many days are in between those days. So i would need to do something like:
4/4/2019 - 7/4/2019 = 3 days
and this calculation has to be done for an entire coloumn.
My table look like something about:
costumer id | transaction amount | date |
sr1212 | 1111 | 4/4/2020 |
st2455 | 1223 | 5/4/2020 |
sr1212 | 4321 | 7/4/2020 |
so my result should be:
costumer id | number of transaction | days in between |
sr1212 | 2 | 3 |
st2455 | 1 | 0 |
Can you help me?
Thank you so much
Solved! Go to Solution.
Hi @carol_mar ,
//Measures
number of transaction =
COUNT(Sheet7[transaction amount])
days in between =
VAR x = MAX(Sheet7[date])
VAR y = MIN(Sheet7[date])
RETURN
DATEDIFF(y,x,DAY)
You must add [costumer id] column into the table chart or the matrix chart, doing this is equivalent to using ALLEXCEPT() function.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |