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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
smpa01
Community Champion
Community Champion

Multiple Intermediate step

@ImkeF  came across this awesome link  and I was wondering if there is a way to refer to multiple/any intermediate steps.

 

E.g.

 

// dims table

let
    dimOne = #table({"ky", "valOne"}, {{"ky1", 90.3}, {"ky2", 89.5}}),
    dimTwo = #table({"ky", "valTwo"}, {{"ky1", 1}, {"ky2", 2}}),
    metaStep1 = dimOne meta[ref1=dimOne],
    metaStep2 = dimTwo meta[ref2=dimTwo]
in
    metaStep2

//facts table
let
    fact = #table({"ky", "amt"}, {{"ky1", 100}, {"ky2", 200}}),
    #"Merged Queries" = Table.NestedJoin(fact, {"ky"}, Value.Metadata(dims)[ref2], {"ky"}, "dims", JoinKind.LeftOuter)
in
    #"Merged Queries"

 

 

Is there a way to join metaStep1 in this? The folllowing errors out

 

let
    fact = #table({"ky", "amt"}, {{"ky1", 100}, {"ky2", 200}}),
    #"Merged Queries" = Table.NestedJoin(fact, {"ky"}, Value.Metadata(dims)[ref2], {"ky"}, "dims", JoinKind.LeftOuter),
    #"Removed Columns" = Table.RemoveColumns(#"Merged Queries",{"dims"}),
    #"Merged Queries1" = Table.NestedJoin(#"Removed Columns", {"ky"}, Value.Metadata(dims)[ref1], {"ky"}, "Removed Columns", JoinKind.LeftOuter)
in
    #"Merged Queries1"

 

 

Thank you in advance

@AlexisOlson 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Try changing your dims table to this:

let
    dimOne = #table({"ky", "valOne"}, {{"ky1", 90.3}, {"ky2", 89.5}}),
    dimTwo = #table({"ky", "valTwo"}, {{"ky1", 1}, {"ky2", 2}}),
    metaStep = dimTwo meta[ref1=dimOne, ref2=dimTwo]
in
    metaStep

View solution in original post

4 REPLIES 4
ThxAlot
Super User
Super User

Inspiring post! Nice to put another jaw-dropping trick under my belt!

 

When I dig in MS documentation, it turned out MS put away this pearl in a dusted corner.

Metadata - PowerQuery M | Microsoft Learn



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



AlexisOlson
Super User
Super User

Try changing your dims table to this:

let
    dimOne = #table({"ky", "valOne"}, {{"ky1", 90.3}, {"ky2", 89.5}}),
    dimTwo = #table({"ky", "valTwo"}, {{"ky1", 1}, {"ky2", 2}}),
    metaStep = dimTwo meta[ref1=dimOne, ref2=dimTwo]
in
    metaStep

This does not work in service df

 

Error: Expression.Error: The field 'ref1' of the record wasn't found
//DateTbl
let
  Source = {2023..2025},
  #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
  ------------------------------------------------------------
  metaStep =  #"Replace errors" meta[ref1=Source, ref2= #"Replace errors"]
in
 metaStep

//dimTbl
let
  Source = Text.From(Value.Metadata(DateTbl)[ref1]{1}),
  #"Convert to table" = Table.FromValue(Source)
in
  #"Convert to table"

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

@AlexisOlson This is smooth and elegant !!!

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors