cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

How to reference another table?

HI, everyone

I have this script. It is working.

 

 

let

Election.Results = (state) => let

Source = Web.Page(Web.Contents("http://en.wikipedia.org/wiki/"&state)),

Data5 = Source{0}[Data],

ChangedType = Table.TransformColumnTypes(Data5,{ {"Column2", type text}, {"Column3", type text}})

in

ChangedType,

States = Table.FromRows({{"Gomel_Region"}, {"Brest_Region"}, {"Vitebsk_Region"}}, {"State"}),

InsertedCustom = Table.AddColumn(States, "Custom", each Election.Results([State])),

ExpandCustom = Table.ExpandTableColumn(InsertedCustom, "Custom", { "Column2", "Column3"}, {"Column2", "Column3"})

in

ExpandCustom

 

But I want to change this line. I created the table in Excel I would want to give information from Excel How Can I refer to excel table?

 

 

States = Table.FromRows({{"Gomel_Region"}, {"Brest_Region"}, {"Vitebsk_Region"}}, {"State"}),

 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: How to reference another table?

2 REPLIES 2
Highlighted
Helper I
Helper I

Re: How to reference another table?

I try to use this code 

 

 

let

Election.Results = (state) => let

Source = Web.Page(Web.Contents("http://en.wikipedia.org/wiki/"&state)),

Data5 = Source{0}[Data],

ChangedType = Table.TransformColumnTypes(Data5,{ {"Column2", type text}, {"Column3", type text}})

in

ChangedType,

States =Table.FromList( Table.Column(Region,"Region"), Splitter.SplitByNothing(), null, null, ExtraValues.Error),

//States = Table.FromList(States1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
// States = Table.RenameColumns(States2,{{"Column1", "State"}}),

InsertedCustom = Table.AddColumn(States, "TEST", each Election.Results([Column1])),

ExpandCustom = Table.ExpandTableColumn(InsertedCustom, "TEST", { "Column2", "Column3"}, {"Column2", "Column3"})

in

ExpandCustom

 

But I have error

Highlighted
Helper I
Helper I

Re: How to reference another table?

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors