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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Use data from one table as column header in an other

Hi,

 

I have a set of flat filers I've imported into Power BI. One table contains names of facts on another: 

Fact Table:

Fact_ID   Fact_Name

1            Value

2            Volume

3            Units

 

The other Table has all the data with the Fact_ID's as column headers:

 

Customer_ID  Date   1 (Fact_ID)  2(Fact_ID   3(Fact_ID)

123                 01.01.18   253,5      25            36

 

Is there a way that I can connect the to tables and then rename the columns in the data table to the Fact_Names so that I get:

 

Customer_ID  Date         Value      Volume    Units

123                 01.01.18   253,5      25            36

 

 

Br Kent

1 ACCEPTED SOLUTION
Seward12533
Solution Sage
Solution Sage

there may be other ways but this works. 

https://1drv.ms/u/s!AuCIkLeqFmlhhJtFY3gZFrFHZDoxlQ

 

Did this in the query editor

  • From Headers Table
    • Add Dummy Columns with values set the names of any leader columns in the source data 
    • Demote Headers
    • Reorder Columns 
    • Keep only 1st  Row
  • Append Headers and Fact Tables 
    • Promote 1st Row as headers

 

Save and Load 

Tip - if you want to not have the orignal Headers and Fact Tables you can set them to not load (right click over query and uncheck Load

 

 

View solution in original post

2 REPLIES 2
Seward12533
Solution Sage
Solution Sage

there may be other ways but this works. 

https://1drv.ms/u/s!AuCIkLeqFmlhhJtFY3gZFrFHZDoxlQ

 

Did this in the query editor

  • From Headers Table
    • Add Dummy Columns with values set the names of any leader columns in the source data 
    • Demote Headers
    • Reorder Columns 
    • Keep only 1st  Row
  • Append Headers and Fact Tables 
    • Promote 1st Row as headers

 

Save and Load 

Tip - if you want to not have the orignal Headers and Fact Tables you can set them to not load (right click over query and uncheck Load

 

 

Anonymous
Not applicable

Wunderfull Seward12533!,

 

That is good enough for me!

 

Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.