Forum Discussion
mdrammeh
9 years agoHelper III
IF Statement using Power Query
Hello, I am trying to write an IF statement to capture the following dates. I have and excel spreadsheet withs millions of records. For one of the columns in my spreadsheet, I want to create a ne...
- 9 years ago
Try this code:
= if [DT_SCHED] < #date(2017,6,1) then "DELIVERY DATE JUNE 1ST" else if [DT_SCHED] < #date(2017,12,31) then "DELIVERY DATE DECEMBER 1ST" else null
PQ is case sensitive and if...then...else is all lower case, just like null.
Also mind your boundaries: in your information, June 1st is undefined; in the code above it returns December 1.
Likewise, December 31, 2017 will return null, according to the specifications provided.
How can you have millions of rows in Excel? As far as I know, Excel has a maximum of 1,048,576 rows
Anonymous
2 years agoNot applicable
Hi Guys, I need to write this in Power query (powerbi) -> can someone help?
=IF(LEN(sellbydate)>1,IF(sellbydate<=(2024,10,31),"save","del"),"del")
- niiannang12 years agoNew Member
Hi,
Please I need help with a formula if I have a cheque date and a current date what formula will I use for the following conditions:
- Less than 1month -Green
- More than 1month but less than 3months-Amber
- More than 3 months at the cash office -Red