Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe'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
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 ID | Location rate name | Payment rate |
| 1512 | Standard day rate | 430 |
| 1512 | Weekend Shifts | 350 |
| 1513 | Standard day rate | 430 |
| 1513 | Weekend Shifts | 350 |
| 1514 | Standard day rate | 430 |
| 1514 | Weekend Shifts | 350 |
TABLE 3 - Desired result
| Location ID | Standard day rate | Weekend Shifts |
| 1512 | 430 | 350 |
| 1513 | 430 | 350 |
| 1514 | 430 | 350 |
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]
)
)
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
@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])
In Power query,
'Pivot' (on the Transform tab) the 'Location Rate Name' column using 'Payment Rate' as the Value
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 37 | |
| 34 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 70 | |
| 37 | |
| 35 | |
| 25 |