Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |