Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I'm in the process of creating reports for Terraform Audit logs, because of how you look up the details for each record in the AuditLog I thought the best approach would be to use a reference table and then use that in multiple lookups.
So Idea is
This approach I thought would provide me
To my surprise when I try to set up a 1-to-1 relationship between tables 2&3 I find these tables don't have the same amount of records.
What I don't understand is that if table2 and 3 are using the same reference table as their source, how can they have a different about of records
Attached is the Power query
Question is: How can 2 idenitiy tables using the same reference can have a different amount of records in them?
// dynamic_auditlog
let
Source = (page as number) =>
let
Source = Json.Document(Web.Contents("https://app.terraform.io", [Headers=[#"Content-Type"="application/vnd.api+json", Authorization="Bearer #############################################################"], RelativePath = "/api/v2/organization/audit-trail?page[number]="& Number.ToText(page) & "&page[size]=1000"])),
results = Source[data]
in
results
in
Source
// reference_table1
let
Source = List.Generate(
() => [Result = try dynamic_auditlog(1) otherwise null, pagenumber=1],
each List.IsEmpty([Result]) = false,
each [Result = try dynamic_auditlog(pagenumber) otherwise null, pagenumber = [pagenumber] + 1],
each [Result]),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandListColumn(#"Converted to Table", "Column1")
in
#"Expanded Column1"
// table2
let
Source = reference_table1,
#"Expanded Column1" = Table.ExpandRecordColumn(Source, "Column1", {"id", "resource"}, {"id", "resource"}),
#"Expanded resource" = Table.ExpandRecordColumn(#"Expanded Column1", "resource", {"id", "type"}, {"id.1", "type"})
in
#"Expanded resource"
// table3
let
Source = reference_table1,
#"Expanded Column1" = Table.ExpandRecordColumn(Source, "Column1", {"id", "resource"}, {"id", "resource"}),
#"Expanded resource" = Table.ExpandRecordColumn(#"Expanded Column1", "resource", {"id", "type"}, {"id.1", "type"})
in
#"Expanded resource"
Different amount of records or different number of rows? You are doing a lot of hierarchy flattening which will result in the increase of the number of rows, but not necessarily the amount of records. (The term "record" has its own meaning in Power BI so you want to use it with care)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 79 | |
| 48 | |
| 35 | |
| 31 | |
| 27 |