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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
airwolf39
Helper V
Helper V

IF function and Date issue

Hi guys,

 

An easy function has me stumped. I have a date column on the left (and it is formated as a date column) along with 'budgeted', and 'actual'. What i am trying to do is create a calculated column that pulls 'Actual' data for dates prior to 10/1/2020 and then also pulls 'budget' data for dates after 10/1/2020 in one unified column: formula.PNG

Data.PNG

 

What is happening is that budget for the entire year is being used, even for the dates after 10/1/2020. Any ideas?

 

Thanks.

1 ACCEPTED SOLUTION

@airwolf39 

is this what you want?

Column = if('Table'[month]<=date(2020,10,1),[Acutal],[Budgeted])
 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
ryan_mayu
Super User
Super User

@airwolf39 

hope this is helpful. you can get the amount of 2020/10/1

below is the example ,if date is later than 2020/10/1,then amount+the amount of 2020/10/1,

Column = if('Table'[month]>date(2020,10,1),maxx(FILTER('Table','Table'[month]=date(2020,10,1)),'Table'[amount])+'Table'[amount],'Table'[amount])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@airwolf39 ,The information you have provided is not making the problem clear to me. Can you please explain with an example.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Appreciate your Kudos.

I think im doing a poor job explaining what i need: I want the 'Act Mod' column to have 'actual' values prior to 10/1/2020 and 'budgeted' values after 10/1/2020. I dont want to subtract or add anything.  

 

@airwolf39 

is this what you want?

Column = if('Table'[month]<=date(2020,10,1),[Acutal],[Budgeted])
 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Ok, i figured it out. the "<10/1/2020" didnt work. I need to use <date(2020,10,01) for it to work. Wierd. Thanks for your help.

So im not crazy! Yes, this is what i want, but it isnt working. When i use that formula, it only pulls the budgeted values only. Note that 01/01/2020 'Act Mod' column is the 'budgeted' value. Per the formula, the rows ought to be 'actual' values.

Data.PNG

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.