Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I have a date field and I need to identify the next multiple of 9 months since that date and it has to be after the current date, so for example:
Date = 9th March 2018
I need the next multiple of 9 months after this date after today, so:
it would be 9th Sept 2019. The first multiple of 9 months after the original date would be 9th Dec 2018 which is before today's date, so I have to add another 9 months until the date is after today.
My dates go back to 2002.
I have no idea where to start on this one. Has anyone got any ideas or has come across something similar at all?
Many thanks,
Andy
Solved! Go to Solution.
Hi @Anonymous
Assuming you have the date in a column Date in Table1, create a calculated column:
NewCol = VAR Jumps_ = QUOTIENT ( DATEDIFF ( Table1[Date], TODAY (), MONTH ), 9 ) RETURN IF ( EDATE ( Table1[Date], Jumps_ * 9 ) = TODAY (), //Check whether today is exactly 9N months away TODAY (), EDATE ( Table1[Date], ( Jumps_ + 1 ) * 9 ) )
Hi @Anonymous
Assuming you have the date in a column Date in Table1, create a calculated column:
NewCol = VAR Jumps_ = QUOTIENT ( DATEDIFF ( Table1[Date], TODAY (), MONTH ), 9 ) RETURN IF ( EDATE ( Table1[Date], Jumps_ * 9 ) = TODAY (), //Check whether today is exactly 9N months away TODAY (), EDATE ( Table1[Date], ( Jumps_ + 1 ) * 9 ) )
Thanks @AlB , although I didn't use your exact solution (there were other issues as to why), part of it gave me an idea and I used some of it as part of the solution to get the result I needed. Thank you so much for replying and giving me that point in the right direction.
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |