Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi All,
I am creating a column that groups file types that are less important and excluding the types I want to keep.
I managed this using the following code at the bottom, I am looking for a better way to do this something like:
exclude filetypes IN {"zip","doc","pdf"}.
Here is my existing code that I later convert to a list that is used in a merge colomns. This works but find this is not optimal if I later want to add file types.
Any assistance kindly appreciated.
= Table.AddColumn(#"Converted to Table", "Other File Types",
each if Text.StartsWith([Column1],"doc") or
Text.StartsWith([Column1],"zip")
or Text.StartsWith([Column1],"pdf")
or Text.StartsWith([Column1],"xls")
or Text.StartsWith([Column1],"dwg")
then null else [Column1], type text)
Solved! Go to Solution.
= Table.AddColumn(#"Converted to Table", "Other File Types",
each if List.Contains({"zip","doc","pdf"},[Column1],(x,y)=>Text.StartsWith(y,x,Comparer.OrdinalIgnoreCase)) then null else [Column1], type text)
= Table.AddColumn(#"Converted to Table", "Other File Types",
each if List.Contains({"zip","doc","pdf"},[Column1],(x,y)=>Text.StartsWith(y,x,Comparer.OrdinalIgnoreCase)) then null else [Column1], type text)
thanks @wdx223_Daniel
That is exactly what I was looking for and I learnt something today!