Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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 it should become 22/09/2020.
Regards
Gaurav
Solved! Go to Solution.
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.
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.
@Gaurav_84 , Not very clear. Try this formula
=
var _min =Minx(allselected(table),Table[[finish_dt]])
var _max = date(year(_min), month(_min)-1,day(_min))
return
return
calculate([measure], filter(Date, Date[Date] >=_min && Date[Date]>=_min))
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 49 | |
| 40 | |
| 37 | |
| 14 | |
| 14 |
| User | Count |
|---|---|
| 86 | |
| 69 | |
| 37 | |
| 29 | |
| 26 |