Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
HI,
I have created a variable called _lastdate.
I would need another variable that shows _lastdate minus 1 month, so if _lastdate is 15 July 2022, _1month should be 15 June 2022.
Formula below gives an error message:
Solved! Go to Solution.
Hi @bsz412
Try to update your code like this:
CHrn vs Last =
Var _Lastdate= calculte(...)
Var _Last_Year = year(_Lastdate)
Var _Last_Month = month(_Lastdate)
Var _Last_Day = Day(_Lastdate)
Var _1month=Date(_Last_Year,_Last_Month-1,_Last_Day)
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn | Twitter | Blog | YouTube
Hi @bsz412
Try to update your code like this:
CHrn vs Last =
Var _Lastdate= calculte(...)
Var _Last_Year = year(_Lastdate)
Var _Last_Month = month(_Lastdate)
Var _Last_Day = Day(_Lastdate)
Var _1month=Date(_Last_Year,_Last_Month-1,_Last_Day)
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn | Twitter | Blog | YouTube
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
76 | |
61 | |
37 | |
33 |
User | Count |
---|---|
99 | |
56 | |
50 | |
42 | |
40 |