Forum Discussion
Gaurav_84
5 years agoHelper I
Dax Generate function
Hi Expert, Please help me with below DAX function it was share with me in my older post. Is there any way to achieve M-1 from effective date. Suppose if my effective date is 22/10/2020 with m-1 ...
- 5 years ago
Hi, Gaurav_84
It’s my pleasure to answer for you.
According to your description, I think you can define a variable as ‘m-1’date.
Like this:
Measure = var dateymd=MAX('Table'[Effective date]) var year=YEAR(dateymd) var month=MONTH(dateymd)-1 var day=DAY(dateymd) var effevtivedate=DATE(year,month,day) return effevtivedateIf it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-janeyg-msft
5 years agoCommunity Support
Hi, Gaurav_84
It’s my pleasure to answer for you.
According to your description, I think you can define a variable as ‘m-1’date.
Like this:
Measure =
var dateymd=MAX('Table'[Effective date])
var year=YEAR(dateymd)
var month=MONTH(dateymd)-1
var day=DAY(dateymd)
var effevtivedate=DATE(year,month,day)
return effevtivedate
If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.