Forum Discussion

memoalkatib1's avatar
memoalkatib1
Frequent Visitor
3 years ago

dataflow create tables for each distinct value in column

I am working on a dataflow that pulls an excel sheet that has a list of tables in the format of rows and columns.I'm trying to extract a dimension table for each table available . is there a dynamic way to create a table for each Value column ? I tried grouping the main table by the Value column and got a result of one unique value and a column with the format "table", I can "step" into each table, but have to repeat the same process a 100 times.  Is there an easy way to extract the list and create a table for each unique value ? 

I found a really good solution here: but in the example, all the rows are equal and is splitting the tables for each 3 rows, where in my example, each table and count of rows is diffeerent. here is the link : https://www.thepoweruser.com/2019/12/19/split-segment-partition-section-your-table-in-power-bi-power-query/

The value column is what ties my fact table with the list of options from the label column

Here is an example of the table that I am trying to split into many tables in order to create them as stand alone dimension tables: 
 
Value                            List                  Label
S_SPONSOR_ID            DK                 Do not know
 S_SPONSOR_ID            NA                 N/A
  S_SPONSOR_ID          RE                     Refusal
 
S_ORGANIZATION        DK                    Do not know
S_ORGANIZATION        NA                       N/A
 S_ORGANIZATION          RE                          Refusal


S_ORGTYPE                    1                         Private
 S_ORGTYPE                    2                             Public
 S_ORGTYPE                3                          Not-for profit
   S_ORGTYPE                4                           Other

 




Here is the result i got from grouping the table by Value column

Value                           Data
S_SPONSOR_ID           Table
S_ORGANIZATION       Table
S_ORGTYPE                  Table


1 Reply

  •  is there a dynamic way to create a table 

    You cannot do that in Power Query. Needs to happen further upstream.