Forum Discussion
WanderingBI
Resolver III
2 years agoIs there a way to explicitly change a column type in Power Query?
Suppose I create a table: let
tableA = #table(
{"Test"},
{
{1 as number},
{"2" as text}
}
)
in
tableA Then I check the column type of...
- 2 years ago
to create table you want with #table
let tableA = #table( type table [Test = Int64.Type], { {1 as number}, {"2" as text} } ) in tableAto change type of existing table
Value.ReplaceType(tableA, type table [Test = Int64.Type])background: read Ben Gribaudo's PQ M Primer, type system part.
AlienSx
Super User
2 years agoto create table you want with #table
let
tableA = #table(
type table [Test = Int64.Type],
{
{1 as number},
{"2" as text}
}
)
in
tableA
to change type of existing table
Value.ReplaceType(tableA, type table [Test = Int64.Type])
background: read Ben Gribaudo's PQ M Primer, type system part.
WanderingBI
Resolver III
2 years agoThank you so much, that was exactly what I was looking for. The background link is also very valuable.