Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Custom Column Formula Error - not getting expected results

Hi Experts

 

I have the following Custom Column Formula

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"

 

When i add the new column it give me dates that are in 2012, 2021 (jan) as "4YOP" when they should be Actual and Feb 21, Mar 21 and April 21 as Actuals...

All Future dates i.e March onwards should be "4YOP" and all historical dates "Actuals"....

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,

 

if  [Sales Date] <= Date.EndOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()),-1))
then "Actual" else "4YOP"

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous ,

 

if  [Sales Date] <= Date.EndOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()),-1))
then "Actual" else "4YOP"

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.