This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi, after searching the help topics I am still requiring help to complete what would seem a simple requirement.
I have 2 tables as shown containing Payroll Dates and Contractor Payroll Dates
Payroll Dates
Contractor Payroll Dates
I am trying to create a table that combines both tables so I have the ability to identify missing payroll dates to look like this
|
Solved! Go to Solution.
You have to replace first two steps with your table references. If you don't know how to do it - check comments below.
Result:
let
PayrollDates = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Tc/LCUAhEEPRXmYtmBn/tYj9t/HE8CDLnFXu3hYzw3MgqiVzO+nSEopHBUKF5EL10d2InxophDqpCA1SFZqkJrRIXchBG2r8j6nGACw1FjjUbsL5AA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [PayrollDate = _t, PayrollDayNumber = _t]),
ContractorPayrollDates = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSjQwCjQ2AAFDDzPPVE9HbyUdJSNLfQNDfSMDIxOlWB0caowNiFBjSFgNUIGBESE1RkSoMSZCjQkRakyJUGNGhBpzPGo8PB0NCLkHpgafe2BqkNwTCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Contractor__c = _t, Site_Start_Date__c = _t]),
ChangedTypePayrollDates = Table.TransformColumnTypes(PayrollDates,{{"PayrollDate", type date}, {"PayrollDayNumber", Int64.Type}}, "sk-SK"),
ChangedTypeContractorPayrollDates = Table.TransformColumnTypes(ContractorPayrollDates,{{"Site_Start_Date__c", type date}}),
GroupedRows = Table.Group(ChangedTypeContractorPayrollDates, {"Contractor__c"}, {{"All", each _, type table [Contractor__c=nullable text, Site_Start_Date__c=nullable date]}}),
Ad_PayrollDates = Table.AddColumn(GroupedRows, "PayrollDates", each ChangedTypePayrollDates, type table),
ExpandedPayrollDates = Table.ExpandTableColumn(Ad_PayrollDates, "PayrollDates", {"PayrollDate", "PayrollDayNumber"}, {"PayrollDate", "PayrollDayNumber"}),
Ad_SiteStartDateC = Table.AddColumn(ExpandedPayrollDates, "Site_Start_Date__c", each if List.Contains([All][Site_Start_Date__c], [PayrollDate]) then [PayrollDate] else null, type date),
RemovedColumns = Table.RemoveColumns(Ad_SiteStartDateC,{"All"}),
ReorderedColumns = Table.ReorderColumns(RemovedColumns,{"Contractor__c", "Site_Start_Date__c", "PayrollDate", "PayrollDayNumber"})
in
ReorderedColumns
You have to replace first two steps with your table references. If you don't know how to do it - check comments below.
Result:
let
PayrollDates = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Tc/LCUAhEEPRXmYtmBn/tYj9t/HE8CDLnFXu3hYzw3MgqiVzO+nSEopHBUKF5EL10d2InxophDqpCA1SFZqkJrRIXchBG2r8j6nGACw1FjjUbsL5AA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [PayrollDate = _t, PayrollDayNumber = _t]),
ContractorPayrollDates = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSjQwCjQ2AAFDDzPPVE9HbyUdJSNLfQNDfSMDIxOlWB0caowNiFBjSFgNUIGBESE1RkSoMSZCjQkRakyJUGNGhBpzPGo8PB0NCLkHpgafe2BqkNwTCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Contractor__c = _t, Site_Start_Date__c = _t]),
ChangedTypePayrollDates = Table.TransformColumnTypes(PayrollDates,{{"PayrollDate", type date}, {"PayrollDayNumber", Int64.Type}}, "sk-SK"),
ChangedTypeContractorPayrollDates = Table.TransformColumnTypes(ContractorPayrollDates,{{"Site_Start_Date__c", type date}}),
GroupedRows = Table.Group(ChangedTypeContractorPayrollDates, {"Contractor__c"}, {{"All", each _, type table [Contractor__c=nullable text, Site_Start_Date__c=nullable date]}}),
Ad_PayrollDates = Table.AddColumn(GroupedRows, "PayrollDates", each ChangedTypePayrollDates, type table),
ExpandedPayrollDates = Table.ExpandTableColumn(Ad_PayrollDates, "PayrollDates", {"PayrollDate", "PayrollDayNumber"}, {"PayrollDate", "PayrollDayNumber"}),
Ad_SiteStartDateC = Table.AddColumn(ExpandedPayrollDates, "Site_Start_Date__c", each if List.Contains([All][Site_Start_Date__c], [PayrollDate]) then [PayrollDate] else null, type date),
RemovedColumns = Table.RemoveColumns(Ad_SiteStartDateC,{"All"}),
ReorderedColumns = Table.ReorderColumns(RemovedColumns,{"Contractor__c", "Site_Start_Date__c", "PayrollDate", "PayrollDayNumber"})
in
ReorderedColumns
Many thanks worked perfectly
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |