Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi Experts
need a custom column to do the following if the date is current month -1 then "Actual" ie. Feb 21 and all historical months in year and any future period then return "4YOP".
Solved! Go to Solution.
@Anonymous , you have shared your formula. I copy passed same in my file and changed the date and it worked , only in bold need to be changed
if [Sales Date] >= Date.StartOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()),-1)) and [Date] <= Date.EndOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()),-1))
then "Actual" else "4YOP"
@Anonymous , Try a new column like
if [Date] >= Date.StartOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()),-1)) and [Date] <= Date.EndOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()),-1))
then "Actual" else "4YOP"
Getting an error here "Actual" - message Token Eof expected? - or alternatively on then
@Anonymous , you have shared your formula. I copy passed same in my file and changed the date and it worked , only in bold need to be changed
if [Sales Date] >= Date.StartOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()),-1)) and [Date] <= Date.EndOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()),-1))
then "Actual" else "4YOP"
Apologies my fault... i had IF as opposed to if.... thanks Amit
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.