power query dates

rjmdc

Well-known Member
Joined
Apr 29, 2020
Messages
693
Office Version
  1. 365
Platform
  1. Windows
hi
i removed the variables and instead used real dates
i still get a null
whats wrong with the equation?
Rich (BB code):
= Table.AddColumn(#"Changed Type4", BudgetYear2, each if BudgetYear1 <> null then Date.AddYears (Record.Field(_, BudgetYear1),1) 
else if [Adjusted Budget Approval]<> null and #date(2022,6,1) >= #date(2022,1,1) and [Adjusted Budget Approval] <= #date(2022,12,31) then [Adjusted Budget Approval]
else null)
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
For starters, to add a simple column, the syntax is
Power Query:
= Table.AddColumn(#"Changed Type4", "BudgetYear2", each if [BudgetYear1] <> null then Date.AddYears( [BudgetYear1], 1) else null)
Note that BudgetYear2 - the name of the new column is in quotes, and the referenced column BudgetYear1 is within square brackets.
Having a more complete table might help, but there are others in the forum much better at M than I am!
If you post a small sample table, be sure to use XL2BB.
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,111
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top