Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
carol_mar
Helper I
Helper I

date

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 idtransaction amountdate
sr121211114/4/2020
st245512235/4/2020
sr121243217/4/2020

 

so my result should be:

 

costumer idnumber of transactiondays in between 
sr121223
st245510

 

Can you help me?

 

Thank you so much

 

@az38 

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

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)

 

mm9.PNG

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.

View solution in original post

15 REPLIES 15

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.