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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
HenryJS
Post Prodigy
Post Prodigy

Data Restructure: New Column

Hi all,

 

I have two tables (below)

 

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

 

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

 

Table 1 

Placement ID
1512
1513
1514

 

 

Table 2

Placement IDPlacements Rate NamePay Rate
1512Standard Day Rate430
1512Shifts Weekend350
1513Standard Day Rate430
1513Shifts Weekend350
1514Standard Day Rate430
1514Shifts Weekend350

 

 

TABLE 3 - Desired Outcome

Placement IDStandard Day RateShifts Weekend
1512430350
1513430350
1514430350
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@HenryJS , Try 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])

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@HenryJS , Try 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])

@amitchandak is there a way of doing this without stating the 'Rate Name'?

 

So it just createst a new column for each different string in the rate name column?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.