Forum Discussion
PPStar
1 year agoHelper V
Creating a custom column to filter data
Hello. I have a very very large table being imported into my dataflow. i have a lot of columns, but for this post, i will shorten it with less columns Title | Category | Date A | E ...
SamWiseOwl
1 year agoSuper User
Hi PPStar
DateDiff lets you work out the difference in days/months/years etc
Switch =
SWITCH(
TRUE()
,[Category] in {"E","F"}, "Category A"
,DATEDIFF([Date], TODAY(),YEAR) <2, "Category B", "Exclude")
- PPStar1 year agoHelper V
HI, Thanks for your reply.
I get a Token ',' expected with this.
It highlighting the in
- SamWiseOwl1 year agoSuper User
Apologises PPStar
I missed you said query editor
= Table.AddColumn(#"Renamed Columns", "swap", each if [Category] = "E" then "Category A" else if [Category] = "F" then "Category A" else if [Date] >= Date.AddYears(Date.From( DateTimeZone.LocalNow()),-2) then "Category B" else "Exclude")