Forum Discussion

MagikJukas's avatar
MagikJukas
Resolver III
4 years ago
Solved

Add column previous step (drill-down)

Hello,

 

I have query where I created some intermedieries steps calculating a value, which has been drilled down. This step is called "Prior".

 

In the same query, I have a table and I want to add this drill-down value as a column.

 

This is the code I passed: Table.AddColumn(#"Removed Columns", "Custom", each (#"Query1"[Prior])).

I am not sure why it does not work?

 

Meanwhile, I created a second query that give the same value as the "Prior" step in Query1.

If in Query1 I link it to Query2, it works: Table.AddColumn(#"Removed Columns", "Custom", each (#"Query2")).

 

So the question is, how can I link it to a previous step without creating a second query?

 

thanks

 

  • MagikJukas's avatar
    MagikJukas
    4 years ago

    Thanks, but I found it too complicated. 

    I replicated the original formulas within the column.

4 Replies

  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    Most Valuable Professional

    This should be like below where Prior is the last step and Sales is the column which was drilled down

    Table.AddColumn(#"Removed Columns", "Custom", each Prior[Sales])

     

    If the step which generated the list is named test, then use following

    = Table.AddColumn(#"Custom1", "Custom", each test)

    In the second query, you are referring to the last result which is a list which will work in Query1. In above Prior[Sales] is the list.

    • MagikJukas's avatar
      MagikJukas
      Resolver III

      Not sure I understood correctly.

      First of all, "Prior" step has been drilled down. so there is only one value associated with that step.

       

      I tried to pass the following: Table.AddColumn(#"Removed Columns", "Custom", each Prior), but I got the Forumla.Firewall error.

       

      I am looking on the internet to figure out how to solve it...

      any idea?