Forum Discussion
Anonymous
1 year agoNot applicable
Count rows based on format
Hi All, I have a column that is a decimal number data type, however when the user uploads a file in the incorrect format it will push other data types into that column. I'm looking for a solutio...
- 1 year ago
Hi Anonymous
You can try this in Power Query.
let Source = Table.FromColumns({ {1, 1, 1.2, 3, "x"} }, type table [Values = any]), AddType = Table.AddColumn(Source, "Data Type", each let v = [Values] in if Value.Is(v, Number.Type) then (if Number.Mod(v, 1) = 0 then "Integer" else "Number") else "Text", type text) in AddType1,1,1.2,3 and x are the sample values to test whether they're integer, number (with decimal) or a text. The custom column below is what does the checking.
let v = [Values] in if Value.Is(v, Number.Type) then (if Number.Mod(v, 1) = 0 then "Integer" else "Number") else "Text"
v-kathullac
1 year agoCommunity Support
Hi Anonymous ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithanya.