Forum Discussion

Winnie2024's avatar
Winnie2024
New Member
2 years ago
Solved

Dynamic source data for dataflow

In my case, I want to load data into Fabric data flow.Suppose the dynamic table name can be get from one metadata table.  Here is my  M language code:
 
--First get the table name 
Source = Lakehouse.Contents([]),
#"Navigation 1" = Source{[workspaceId = "12333r3r"]}[Data],
#"Navigation 2" = #"Navigation 1"{[lakehouseId = "aaefefe"]}[Data],
my_table_name = #"Navigation 2"{[Id = "est", ItemKind = "Table"]}[Data],
 
---Then get the data from the table name above
#"Navigation 4" = Source{[workspaceId = "6d9a79dc-e9bc-42f8-958b-e5e896744437"]}[Data],
#"Navigation 5" = #"Navigation 1"{[lakehouseId = "aa6082ce-3048-4bc0-aa16-80e06a37697d"]}[Data],
#"Navigation 6" = #"Navigation 2"{[Id =my_table_name , ItemKind = "Table"]}[Data]
in
#"Navigation 6"
 
 
But i got error:
 
 
Any idea? 
Thanks.

4 Replies

  • v-cboorla-msft's avatar
    v-cboorla-msft
    Microsoft Employee

    Hi Winnie2024 

     

    Thanks for using Microsoft Fabric Community.

    Apologies for the inconvenience.

     

    If you get an Expression.Error: The key didn’t match any rows in the table in Power BI, it means that you’ve made some changes to your source file and haven’t updated them in the Power Query. 

    In most cases, the error arises when the Sheet’s Name is not the same on your original and destination file.

     

    For more details please refer : How to Fix “The Key Didn’t Match Any Rows in the Table”.

     

    I hope this information helps. Please do let us know if you have any further questions.

     

    Thanks.

  • miguel's avatar
    miguel
    Community Admin

    Could you please share the full query that you have for your "get table name" query? It should yield a single scalar value. Basically a text string. If it doesn't, that's what's causing the issue in the subsequent query.

    • v-cboorla-msft's avatar
      v-cboorla-msft
      Microsoft Employee

      Hi Winnie2024 


      We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.
      In case if you have any resolution please do share that same with the community as it can be helpful to others.
      Otherwise, will respond back with the more details and we will try to help.


      Thank you.

    • Winnie2024's avatar
      Winnie2024
      New Member

      It worked. Thanks you for your help.