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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
HenryJS
Post Prodigy
Post Prodigy

Data restructuring: New column

Hello everyone

I have two tables (below)

I would like to create new columns in Table 1. One for each ''Location Rate Name' in Table 2.

The desired result is at the bottom. This has two new columns.

Table 1

Location ID
1512
1513
1514

Table 2

Location IDLocation rate namePayment rate
1512Standard day rate430
1512Weekend Shifts350
1513Standard day rate430
1513Weekend Shifts350
1514Standard day rate430
1514Weekend Shifts350

TABLE 3 - Desired result

Location IDStandard day rateWeekend Shifts
1512430350
1513430350
1514430350
4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @HenryJS ,

 

Create table3 based on table1 using ADDCOLUMNS.

 

Table3 =
ADDCOLUMNS (
    'Table',
    "Standard day rate", SUMX (
        FILTER (
            'Table (2)',
            'Table'[Location ID] = 'Table (2)'[Location ID]
                && 'Table (2)'[Location rate name] = "Standard day rate"
        ),
        'Table (2)'[Payment rate]
    ),
    "Weekend Shifts", SUMX (
        FILTER (
            'Table (2)',
            'Table'[Location ID] = 'Table (2)'[Location ID]
                && 'Table (2)'[Location rate name] = "Weekend Shifts"
        ),
        'Table (2)'[Payment rate]
    )
)

 

test_table3.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@V-lianl-msft Hi,

 

I would like it to be additional columns onto table 1. Is it possible to do without stating the'Rate Names'. So it just picks up the differen strings and creates a new column for each one.

 

Cheers

amitchandak
Super User
Super User

@HenryJS , Try These two new column in Table 1

 

Standard day rate = maxx(filter(table2,table2[Location ID] =table1[Location ID] && table2[Location rate name] ="Standard day rate"),table2[Payment rate])
Weekend Shifts = maxx(filter(table2,table2[Location ID] =table1[Location ID] && table2[Location rate name] ="Weekend Shifts"),table2[Payment rate])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
HotChilli
Community Champion
Community Champion

In Power query,

'Pivot' (on the Transform tab)  the 'Location Rate Name' column using 'Payment Rate' as the Value

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.