Forum Discussion

slice_dice's avatar
slice_dice
Frequent Visitor
2 years ago
Solved

Issue: Promoting Headers removes all other rows

I have a table with a about 186 rows. The headers are on the first row. 

When I promote headers, all rows but the first row of data disappears.
= Table.PromoteHeaders(<table>)
Not sure why?

  • lbendlin's avatar
    lbendlin
    2 years ago

    A table definition in Excel should work just fine.  Power BI will read that meta data and pull the entire table contents, based on the current size of the table.

     

    NOTE:  This statement is only valid for rows of course.  Dynamic columns are not well supported.

4 Replies

  • Show the data before promotion. And share your full m code (view/advanced editor + copy/paste)

    • slice_dice's avatar
      slice_dice
      Frequent Visitor

      Hey thanks.  I think I figured out what was going on.

      Not sure if there is a workaround but if you set a dynamic named range in excel and injest the data into power query, at first it show the entire dataset. But the moment you try and run a function or anything on the dataset, it somehow drops all the rows. 

      I made the dynamic named range with this formula in excel. 

      =$CG$7:INDEX($CG$7:$CU$2102,COUNTA(CG8#)+1,COUNTA($CG$7:$CU$7)-1)

      What it does is expand or contract the named range based on the row and column count.

      My ultimate goal was to set up a process where I can "enrich" certain data from using the info from this named range. Since the size of the table changes, I figured it would be good to have a dynamic named range.  The issue is that PowerQuery doesn't seem to play well with Dynamic Named ranges.

       

      I can't use a table because I need the spill functionality to adjust the size of the range.

       

      Not sure if there are any good workarounds.

      • lbendlin's avatar
        lbendlin
        Super User

        A table definition in Excel should work just fine.  Power BI will read that meta data and pull the entire table contents, based on the current size of the table.

         

        NOTE:  This statement is only valid for rows of course.  Dynamic columns are not well supported.