Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
fiorela
Helper I
Helper I

Refresh table

Hi All,

 

I'm having issue with refresh data. I've loaded a csv from "Get Data" , TXT/CSV. Then, from PowerQuery Editor, I have copied the original table and made changes. Now, if i change the file path, only update the original table, while the copy keeps the old path.

 

Any suggestion?

 

thanks!

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @fiorela 

In PowerQuery you can use a query as the source for another query.  For example, if you load a data table then you walso want to have another table of just the customer names and you extract that from the data you can just make another query that references the first and make your changes.

In my example I have a table called "data"

I have a second query where I have copied data and made some changes.  In the advanced editor I can change the source for mye "data updated" query from the orignal .csv to the data query.

 

Original query for "data update"

let
    Source = Csv.Document(File.Contents("C:\Data\data.csv"),[Delimiter=",", Columns=5, Encoding=65001, QuoteStyle=QuoteStyle.None]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Year Month", type date}, {"Sales Amount", type number}, {"Sales YTD", type number}, {"Sales R12", type number}, {"AVG R6", type number}}),
    #"Removed Top Rows" = Table.Skip(#"Changed Type",1),
    #"Filtered Rows" = Table.SelectRows(#"Removed Top Rows", each ([Sales Amount] <> null))
in
    #"Filtered Rows"

Updated query using "data" as my source.  Notice I did have to remove the "Promoted Headers" step.

let
    Source = data,
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Year Month", type date}, {"Sales Amount", type number}, {"Sales YTD", type number}, {"Sales R12", type number}, {"AVG R6", type number}}),
    #"Removed Top Rows" = Table.Skip(#"Changed Type",1),
    #"Filtered Rows" = Table.SelectRows(#"Removed Top Rows", each ([Sales Amount] <> null))
in
    #"Filtered Rows"

 

 

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

Hello @fiorela 

In PowerQuery you can use a query as the source for another query.  For example, if you load a data table then you walso want to have another table of just the customer names and you extract that from the data you can just make another query that references the first and make your changes.

In my example I have a table called "data"

I have a second query where I have copied data and made some changes.  In the advanced editor I can change the source for mye "data updated" query from the orignal .csv to the data query.

 

Original query for "data update"

let
    Source = Csv.Document(File.Contents("C:\Data\data.csv"),[Delimiter=",", Columns=5, Encoding=65001, QuoteStyle=QuoteStyle.None]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Year Month", type date}, {"Sales Amount", type number}, {"Sales YTD", type number}, {"Sales R12", type number}, {"AVG R6", type number}}),
    #"Removed Top Rows" = Table.Skip(#"Changed Type",1),
    #"Filtered Rows" = Table.SelectRows(#"Removed Top Rows", each ([Sales Amount] <> null))
in
    #"Filtered Rows"

Updated query using "data" as my source.  Notice I did have to remove the "Promoted Headers" step.

let
    Source = data,
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Year Month", type date}, {"Sales Amount", type number}, {"Sales YTD", type number}, {"Sales R12", type number}, {"AVG R6", type number}}),
    #"Removed Top Rows" = Table.Skip(#"Changed Type",1),
    #"Filtered Rows" = Table.SelectRows(#"Removed Top Rows", each ([Sales Amount] <> null))
in
    #"Filtered Rows"

 

 

 

you rock !! many many thanks 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.