Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I have a series of workbooks that I've called using
let
Source = Folder.Files("C:\Users\MichaelDaugherty\Desktop\M_Daugherty\Pay\PayPeriods"),
AddColumn = Table.AddColumn(Source, "Custom", each Excel.Workbook(File.Contents([Folder Path]&[Name]))),
ExpandedCustom = Table.ExpandTableColumn(#"AddColumn", "Custom", {"Name", "Data"}, {"Custom.Name", "Custom.Data"}),
in
ExpandedCustom
and now I have a column [Column.Data] that contains a table on each row. Each table contains the same general information but often extra rows describing differnt methods of pay.
| Hours | |
| Regular Pay | 40 |
| Overtime Pay | 5 |
| Sunday Differential | 8 |
| Hours | |
| Regular Pay | 32 |
| Holiday Pay | 8 |
| Overtime Pay | 5 |
| Sunday Differential | 8 |
How would I (can I?) iterate over each table, find the value for overtime pay, and add it to a new column. I've only ever used basic search queries on tables that were all formatted the same so I could call it by column and row but with the row number being variable I'm stumped.
The below example does not work, but just gives me a new column with "FALSE" for each row. Any advise would be appreciated.
let
Source = Folder.Files("C:\Users\MichaelDaugherty\Desktop\M_Daugherty\Pay\PayPeriods"),
AddColumn = Table.AddColumn(Source, "Custom", each Excel.Workbook(File.Contents([Folder Path]&[Name]))),
ExpandedCustom = Table.ExpandTableColumn(#"AddColumn", "Custom", {"Name", "Data"}, {"Custom.Name", "Custom.Data"}),
Overtime = Table.AddColumn(ExpandedCustom, "Overtime", each [Custom.Data][Column2] = "Overtime Pay")
in
Overtime
Solved! Go to Solution.
Hi @Anonymous
Modify your last line a little bit, there are 2 tables concept here...
= Table.AddColumn(ExpandedCustom, "Overtime", each Table.SelectRows( [Custom.Data], each [Column1] = "Overtime Pay")[Column2]{0}?)
Hi @Anonymous
Modify your last line a little bit, there are 2 tables concept here...
= Table.AddColumn(ExpandedCustom, "Overtime", each Table.SelectRows( [Custom.Data], each [Column1] = "Overtime Pay")[Column2]{0}?)
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 9 | |
| 8 | |
| 8 | |
| 6 |