Forum Discussion
Conditional columns
- Anonymous6 years ago
Hi Anonymous ,
Create a custom column in Power Query like below.
if [date]<=Date.From(DateTime.LocalNow()) then "due" else ""When you refresh the dataset, the column will be changed.
Best Regards,
Jay
Here you go I placed teh data in excel. I removed a lot of the other data elements, but you can see what im trying to do. Basically the file refershes each day. Uses a column in PBI called FOLLOW UP DATE this houses dates of the files. I wanted to build a conditional column to call out all over due files...files that have dates prior to todays date each day so tomorrow anything marked 7/23 would now have the over due tag.
Hi Anonymous ,
Create a custom column in Power Query like below.
if [date]<=Date.From(DateTime.LocalNow()) then "due" else ""
When you refresh the dataset, the column will be changed.
Best Regards,
Jay
- Anonymous6 years agoNot applicable
Thanks this seemed to work, but 1 issue im running into is all the blanks in the query editer are coming back showing NULL, so when I refresh the data it keeps flagging those as errors. Anything I can add in the code to make blanks blank and not say NULL?
- Anonymous6 years agoNot applicable
GM Anonymous
Im using the code you gave me above and it works to bring back the due and over due. Im running into an issue now that when the date field im bouncing off is empty it gives me an error in the custom column.
I tried removing Errors, but then it takes thoserows out of the data and we still need to see those. How can I go about adding something telling it if the value is NULL in the date feild say blank or show a blank value in the custom column?
Thanks for the help in advance!
- Anonymous6 years agoNot applicable
I figured if the conditon said if [RESOLVER_FOLLOW_UP_DATE]<Date.From(DateTime.LocalNow()) then "Over Due" else "Not Due" it would put that for a row that may be blank, but it doesnt and shows error for fields with no date.