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.
| MajorGroup | MinorGroup | Sample |
| 1 | 6 | 3 |
| 1 | 5 | 2 |
Above is an example of my data table to which I am trying to add the # of samples for each MajorGroup/MinorGroup as rows counting down to 1. An example of the desired output table is seen below.
---->
| MajorGroup | MinorGroup | Sample |
| 1 | 6 | 3 |
| 1 | 6 | 2 |
| 1 | 6 | 1 |
| 1 | 5 | 2 |
| 1 | 5 | 1 |
Solved! Go to Solution.
You can transform the Sample column (or add a new column) that creates a list {1,2,..,N} and then expand that list column to new rows.
Here's the full query I used:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTIDYmOlWB0IzxSIjZRiYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [MajorGroup = _t, MinorGroup = _t, Sample = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"MajorGroup", Int64.Type}, {"MinorGroup", Int64.Type}, {"Sample", Int64.Type}}),
#"Number to list" = Table.TransformColumns(#"Changed Type", {{"Sample", each List.Reverse({1.._}), type list}}),
#"Expanded Sample" = Table.ExpandListColumn(#"Number to list", "Sample")
in
#"Expanded Sample"
You can transform the Sample column (or add a new column) that creates a list {1,2,..,N} and then expand that list column to new rows.
Here's the full query I used:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTIDYmOlWB0IzxSIjZRiYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [MajorGroup = _t, MinorGroup = _t, Sample = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"MajorGroup", Int64.Type}, {"MinorGroup", Int64.Type}, {"Sample", Int64.Type}}),
#"Number to list" = Table.TransformColumns(#"Changed Type", {{"Sample", each List.Reverse({1.._}), type list}}),
#"Expanded Sample" = Table.ExpandListColumn(#"Number to list", "Sample")
in
#"Expanded Sample"
Thanks so much for the help! This 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 |
|---|---|
| 27 | |
| 26 | |
| 22 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 45 | |
| 42 | |
| 41 | |
| 21 | |
| 18 |