Forum Discussion

Pitsere's avatar
Pitsere
Frequent Visitor
2 months ago
Solved

How to refresh data and update from one table to another

Can someone assist me in Making sure my data refresh from one table applies the changes to other linked tables. i have tried everything

  • Hi Pitsere 
    Thanks for the sharing the pbix to my personal chat. I have opened your "Master Product" query and here's exactly what's happening:

    Source = Table.Combine({ "Revlon Product Master Abb", "EA Product Master (ArTrnDetail)" })
           -> Removed Duplicates

    Master Product is an append (Table.Combine) of two product-master tables, and that's the last step. There is no merge to InvMaster anywhere in it, so nothing from InvMaster (Category, Brand, etc.) can ever land on it and no matter how many times you refresh.
    The relationship `Master Product[Product code] -> InvMaster[StockCode]` only  filters at query time; it never copies columns back. That's the whole reason it looks  static.


    You have already use the correct pattern in your own InvMaster query, it does a `Table.NestedJoin` + expand to pull Brand/Category/Sub Brand from "InvMaster+ inventory master (EA)".
    Master Product just needs the same treatment.

    Workaround is to add a Merge as the last steps of Master Product : 

    1. Power Query -> select  Master Product.
    2. Home -> Merge Queries(into the existing query).
    3. Top table:  Master Product , click  -> Product code. Bottom table:  InvMaster , click  StockCode .
      Join kind:  Left Outer.
    4.  Click the expand arrow on the new  InvMaster column, uncheck "use original column name as prefix", and tick the fields you want (e.g.  Category, Brand, Sub Brand).
    5.  Close & Apply. 

    Or just paste this over your current Master Product query (Advanced Editor):

    let
        Source = Table.Combine({#"Revlon Product Master Abb", #"EA Product Master (ArTrnDetail)"}),
        #"Removed Duplicates" = Table.Distinct(Source),
        // normalise the key so matches don't come back blank
        #"Clean Key" = Table.TransformColumns(#"Removed Duplicates", {{"Product code", each Text.Trim(Text.From(_)), type text}}),
        // MERGE (not append) to pull columns from InvMaster by product
        #"Merged InvMaster" = Table.NestedJoin(#"Clean Key", {"Product code"}, InvMaster, {"StockCode"}, "InvMaster", JoinKind.LeftOuter),
        #"Expanded InvMaster" = Table.ExpandTableColumn(#"Merged InvMaster", "InvMaster", {"Category","Brand","Sub Brand"}, {"InvMaster Category","InvMaster Brand","InvMaster Sub Brand"})
    in
        #"Expanded InvMaster"

     Now every refresh re-runs the merge and Master Product stays in sync with InvMaster.

     

    Two things to keep and eye:

    • If the new columns come back blank, the keys don't match exactly. Set both `Product code` and `StockCode` to  Text and apply  Transform -> Format -> Trim before merging (the M above already trims Product code).
    • Franchise: heads-up that InvMaster has no Franchise column only Category/Brand/Sub Brand. So Franchise can't come from InvMaster. If Franchise also needs to refresh, merge it (same technique) from the table that actually holds it per product your Revlon Product Master Bridge has Franchise code/description keyed by Product code.


    Thanks,

    Srikanth Cheri

    Community Support Team

  • Hi Pitsere 

    Yes, replacing the data inside the PBIX works fine for static mappings. Two things:

    1. Match column names & order exactly (I checked your PBIX):
      EA Brand Categories (Manual input) →  Product Class | Brand | Franchise code | Franchise description | Business ID | Brand Group 
      EA Categories  →  Category Code | Category | Main Category | Category Group Code | Category Group 
      Your attached Excel has a different order and looks like "Franchise code" appears twice (one is probably  Category Code ). Fix the headers first, or the merges/relationships will break.
    2. How to replace:
      Transform data → select the table → Home → Enter Data → paste rows from Excel → name it the same as the original → replace old query.
      Repeat for the second table → Close & Apply.
    3. Still apply Part B (the cleaned `EA Brands Manual Input` query without `Table.Skip`). Without it, the downstream table still corrupts when Syspro row counts change.


    Thanks,
    Srikanth Cheri
    Community Support Team

19 Replies

  • Can you elaborate it further the question is not completing the picture? 
    What are you expecting vs what is happening?

    • Pitsere's avatar
      Pitsere
      Frequent Visitor

      Good Day. I have 2 Tables that I  have linked on a many to 1 Cardinality and somehow information on the "InvMaster" Table doest refresh back to the "Master Product" table

       

  • Hello Pitsere
    I think the main problem is what we expect from the relationship. A relationship doesn't update one table from another. It just tells Power BI how the tables relate when the model is queried.
    Microsoft explains relationships here:
    Model relationships in Power BI Desktop 
    So if InvMaster refreshes, that won't write those changes back to Master Product.

    Can I ask how Master Product is populated? Is it loaded directly from the source, or is it created in Power Query? If it's a separate table, you'll usually need a Power Query merge rather than relying on the relationship.

    • Pitsere's avatar
      Pitsere
      Frequent Visitor

      Master Product is Created in Power Query. is there a way to update "Master Product" with the Information on "InvMaster"? See table headers below"

      Master Product

      InvMaster

      i need Franchise and Category updated 

  • In a many to one relationship:

    Data does NOT flow or update between tables
    Relationships are only used for filtering in visuals
    So changes in InvMaster will never refresh back into Master Product
    If there is any new data in Master Product just the table from more option 

    • Pitsere's avatar
      Pitsere
      Frequent Visitor

      Master Product is Created in Power Query. is there a way to update "Master Product" with the Information on "InvMaster"? See table headers below"

      Master Product

       

      InvMaster

       

      i need Franchise and Category updated 

      • mh2587's avatar
        mh2587
        Icon for Super User rankSuper User

        Yes, In table view click on three dots for more option and then click on refresh and last click on Data. 

         

  • v-csrikanth's avatar
    v-csrikanth
    Icon for Community Support rankCommunity Support

    Hi Pitsere 
    Thank you reaching out to Fabric Community.
    If you want Master Product to reflect the latest values from InvMaster on every refresh, handle it at the data-prep layer:
    Open Transform Data (Power Query Editor).

    • Select the Master Product query.
    • Use Merge Queries ->join it with InvMaster on the common key (e.g., ProductID/SKU).
    • Expand the columns you want to bring over from InvMaster.
    • If needed, use a conditional column (if [InvMaster.Field] <> null then [InvMaster.Field] else [MasterProduct.Field]) to have InvMaster values override Master Product.
    • Click Close & Apply.

    Now each refresh will re-run the merge, and Master Product will always be enriched/updated with the latest InvMaster data.

    Thank you,
    Srikanth Cheri
    CST Team.

    • Pitsere's avatar
      Pitsere
      Frequent Visitor

      Hi Srikanth. for some reason, that table is not refreshing. seems like it is static.

  • v-csrikanth's avatar
    v-csrikanth
    Icon for Community Support rankCommunity Support

    Hi Pitsere 

    If Master Product looks static after the merge, try these in order one of them usually fixes it:

    • Check the Source step: In Power Query → Master Product → first Applied Step. If it says Table.FromRows(...), it's an Enter Data table (frozen). Rebuild it from a real source or as a Reference to InvMaster.

    • Check for null merges: If Franchise/Category come back blank, the join key doesn't match. On both queries, apply Trim + set data type to Text on the key column, then redo the merge.

    • Enable refresh on the query: Right-click Master Product → make sure enable load and include in report refresh are both ticked.

    • Use a full refresh: Click Home → Refresh (not the three-dots refresh in table view that only refreshes one table).

    • Refresh InvMaster first: Open View → Query Dependencies to confirm the link. If InvMaster fails to refresh (credentials, path), Master Product keeps stale values.

    Workaround if nothing else works:
    Right-click InvMaster → Reference → rename it "Master Product" → keep only the columns you need → Close & Apply. Now Master Product is always derived from InvMaster and refreshes with it automatically.


    Note: Could you share a screenshot of Master Product's Applied Steps and View → Query Dependencies? That'll confirm which of the above applies.


    Thanks,
    Srikanth Cheri
    Community Support Team

    • Pitsere's avatar
      Pitsere
      Frequent Visitor

      Hi Srikanth. Still not wnning. see Screenshot below.

       

       

      • Pitsere's avatar
        Pitsere
        Frequent Visitor

        Hi Srikanth. Please see the Script. for Master Product

         

  • v-csrikanth's avatar
    v-csrikanth
    Icon for Community Support rankCommunity Support

    Hi Pitsere 
    Thanks for sharing the screenshot.
    As per my inderstanding you are using append queries, but for what you're trying to do (bringing Franchise and Category from InvMaster into Master Product for matching ProductIDs), you need Merge Queries, not Append.

    The two do very different things:

    • Append stacks rows on top of each other — so you'll end up with more rows, and Franchise/Category will just be blank for all the Master Product rows.
    • Merge joins the two tables side-by-side on a common key (ProductID/SKU) and lets you pull columns from InvMaster into Master Product which is what you actually want.

    Please do this instead:

    1. Undo the Append step.
    2. In Power Query, select Master Product.
    3. Click Home -> Merge Queries ->Merge Queries as New (or just Merge Queries to add it to Master Product).
    4. In the dialog:
      • Top table: Master Product, click the ProductID column.
      • Bottom table: InvMaster, click the matching ProductID column.
      • Join Kind: Left Outer (keeps all Master Product rows, adds InvMaster matches).
    5. Click OK. You'll get a new column called InvMaster click the little expand arrow on that column header.
    6. Tick only Franchise and Category, untick "Use original column name as prefix", and click OK.
    7. Close & Apply.

    Now Franchise and Category will populate on every refresh, driven by InvMaster.

    -----------------------------------------------------------
    If the merged columns come back blank

    It usually means the join key doesn't match exactly. Before merging, on both ProductID columns:

    • Change data type to Text
    • Apply Transform -> Format ->Trim

    Then redo the merge.

    Note: If possible could you please share the .pbix file if there is no PII information.

    Thanks,
    Srikanth Cheri
    Community Support Team 

     



    • Pitsere's avatar
      Pitsere
      Frequent Visitor

      Hi Srikanth. Happy to share the PBIX file with you. it is a large file. happy to share with a file transfer.

  • v-csrikanth's avatar
    v-csrikanth
    Icon for Community Support rankCommunity Support

    Hi Pitsere 
    Thanks for the sharing the pbix to my personal chat. I have opened your "Master Product" query and here's exactly what's happening:

    Source = Table.Combine({ "Revlon Product Master Abb", "EA Product Master (ArTrnDetail)" })
           -> Removed Duplicates

    Master Product is an append (Table.Combine) of two product-master tables, and that's the last step. There is no merge to InvMaster anywhere in it, so nothing from InvMaster (Category, Brand, etc.) can ever land on it and no matter how many times you refresh.
    The relationship `Master Product[Product code] -> InvMaster[StockCode]` only  filters at query time; it never copies columns back. That's the whole reason it looks  static.


    You have already use the correct pattern in your own InvMaster query, it does a `Table.NestedJoin` + expand to pull Brand/Category/Sub Brand from "InvMaster+ inventory master (EA)".
    Master Product just needs the same treatment.

    Workaround is to add a Merge as the last steps of Master Product : 

    1. Power Query -> select  Master Product.
    2. Home -> Merge Queries(into the existing query).
    3. Top table:  Master Product , click  -> Product code. Bottom table:  InvMaster , click  StockCode .
      Join kind:  Left Outer.
    4.  Click the expand arrow on the new  InvMaster column, uncheck "use original column name as prefix", and tick the fields you want (e.g.  Category, Brand, Sub Brand).
    5.  Close & Apply. 

    Or just paste this over your current Master Product query (Advanced Editor):

    let
        Source = Table.Combine({#"Revlon Product Master Abb", #"EA Product Master (ArTrnDetail)"}),
        #"Removed Duplicates" = Table.Distinct(Source),
        // normalise the key so matches don't come back blank
        #"Clean Key" = Table.TransformColumns(#"Removed Duplicates", {{"Product code", each Text.Trim(Text.From(_)), type text}}),
        // MERGE (not append) to pull columns from InvMaster by product
        #"Merged InvMaster" = Table.NestedJoin(#"Clean Key", {"Product code"}, InvMaster, {"StockCode"}, "InvMaster", JoinKind.LeftOuter),
        #"Expanded InvMaster" = Table.ExpandTableColumn(#"Merged InvMaster", "InvMaster", {"Category","Brand","Sub Brand"}, {"InvMaster Category","InvMaster Brand","InvMaster Sub Brand"})
    in
        #"Expanded InvMaster"

     Now every refresh re-runs the merge and Master Product stays in sync with InvMaster.

     

    Two things to keep and eye:

    • If the new columns come back blank, the keys don't match exactly. Set both `Product code` and `StockCode` to  Text and apply  Transform -> Format -> Trim before merging (the M above already trims Product code).
    • Franchise: heads-up that InvMaster has no Franchise column only Category/Brand/Sub Brand. So Franchise can't come from InvMaster. If Franchise also needs to refresh, merge it (same technique) from the table that actually holds it per product your Revlon Product Master Bridge has Franchise code/description keyed by Product code.


    Thanks,

    Srikanth Cheri

    Community Support Team

    • Pitsere's avatar
      Pitsere
      Frequent Visitor

      Hi Srikanth. The Solution now Works. Thanks. I have a similar Issue with the EA Brand Categories (Manual Inputs) and EA Brands (Manual Inputs) Table that are also not updating. Can you please look at my steps to see why the data is not updating as well? it is on the same Pbix file i sent.

  • v-csrikanth's avatar
    v-csrikanth
    Icon for Community Support rankCommunity Support

    Hi Pitsere 

    Looked at both tables in the PBIX. Root causes are different from Master Product:


    1. EA Brand Categories (Manual input) and  EA Categories both are "Enter Data" tables (`Table.FromRows(Json.Document(Binary.Decompress(...)))`). Values are hardcoded inside the .pbix. No source to refresh from.


    2.  EA Brands Manual Input starts from live  SalProductClassDes, but then chains hardcoded  Table.Skip(149/1/198/1/200/1/199/1) + repeated  Table.Combine back to the frozen table. If Syspro returns even one extra row, everything shifts.


    Workaround fix in two ways: 

    Move manual mappings to Excel on SharePoint/OneDrive:

    1. Copy current values from both tables into an Excel file (two sheets).

    2. Save to SharePoint or OneDrive for Business.

    3. Get Data → SharePoint/OneDrive → replace both queries with the Excel sheets.

    Business team edits Excel; refresh picks up new brands automatically.


    Replace EA Brands Manual Input with this clean query:

    let
    Source = SalProductClassDes,
    Trimmed = Table.TransformColumns(Source, {{"ProductClass", Text.Trim, type text}}),
    Cleaned = Table.TransformColumns(Trimmed, {{"ProductClass", Text.Clean, type text}}),
    NoUnderscore = Table.SelectRows(Cleaned, each not Text.StartsWith([ProductClass], "_")),
    NoPromo = Table.SelectRows(NoUnderscore, each not Text.Contains([Description], "PROMO")),
    Merged = Table.NestedJoin(NoPromo, {"ProductClass"}, #"EA Brand Categories (Manual input)", {"Product Class"}, "Brands", JoinKind.LeftOuter),
    Expanded = Table.ExpandTableColumn(Merged, "Brands", {"Franchise code","Franchise description","Brand","Brand Group","Business ID"}),
    Renamed = Table.RenameColumns(Expanded, {{"ProductClass", "Product Class"}}),
    DropDesc = Table.RemoveColumns(Renamed, {"Description"}),
    FillGeneric = Table.ReplaceValue(DropDesc, null, "Generic", Replacer.ReplaceValue, {"Franchise description"}),
    Z99Generic = Table.ReplaceValue(FillGeneric, "Z99", "Generic", Replacer.ReplaceText, {"Franchise description"})
    in
    Z99Generic

    Removes all  Table.Skip / repeated appends. Result is stable regardless of source row count.


    Thank you.

    • Pitsere's avatar
      Pitsere
      Frequent Visitor

      Hi Srikanth. Thanks for This. Is there a way I can replace the data on both the tables within the PBIX? the data on the manual input tables hardly changes and i think if i could replace the data on those tables with thie attached data, it would make sense. please let me know if that is not a best practice.

       

  • v-csrikanth's avatar
    v-csrikanth
    Icon for Community Support rankCommunity Support

    Hi Pitsere 

    Yes, replacing the data inside the PBIX works fine for static mappings. Two things:

    1. Match column names & order exactly (I checked your PBIX):
      EA Brand Categories (Manual input) →  Product Class | Brand | Franchise code | Franchise description | Business ID | Brand Group 
      EA Categories  →  Category Code | Category | Main Category | Category Group Code | Category Group 
      Your attached Excel has a different order and looks like "Franchise code" appears twice (one is probably  Category Code ). Fix the headers first, or the merges/relationships will break.
    2. How to replace:
      Transform data → select the table → Home → Enter Data → paste rows from Excel → name it the same as the original → replace old query.
      Repeat for the second table → Close & Apply.
    3. Still apply Part B (the cleaned `EA Brands Manual Input` query without `Table.Skip`). Without it, the downstream table still corrupts when Syspro row counts change.


    Thanks,
    Srikanth Cheri
    Community Support Team