Looking into what "as" and "is" do.
"Is" asks the question: "Can this value be interpreted as this data type?"
It doesn't do data type conversion, i.e. "is '123' a number?" is false, because '123' is text. Note that percentages, whole numbers and decimal numbers all belong to the over-group of number (see bengribaudo.co...)
"As" instead says "if this value can be interpreted as this data type, return the value". This means "'123' as number" will give an error, because '123' is not a number, it's text. Meanwhile "123 as number" gives 123.
I struggle to see when I'd want to use "as" over "is". If I want to exclude e.g. values that aren't dates, I'd rather add a column saying "[Column1] as date", and filter out true's in this new column. Then I can inspect rows with bad values.
00:00 Intro to data set
01:36 Power Bi screwed up my data types...
02:07 Back to Power Query
02:15 Is text
02:42 Is date
02:57 Is datetime
04:12 Is logical
04:22 Is number
04:52 Can't directly check for e.g. Integer-type
05:51 A method to check for integers
07:01 As
07:25 As text
08:22 As date
08:54 As datetime
09:04 As logical
09:15 As number
09:34 As integer (workaround)
10:57 Summary
Негізгі бет 76 - As and Is (Power Query)
No video
Пікірлер: 1