Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Greetings,
I am attempting to utilize a Calculated New Table to create duplicate entries based on the count column. The 'table' I am referencing is called 'Defect Count'.
I also would like for an additional column that tracks the iteration of the defect. I have provided an example below.
Example:
Original Data Table 'Defect Count'
| Defect | Count |
| Too Short | 3 |
| Bump | 1 |
| Brittle Blade | 2 |
Disered Result
| Defect | Count | Iteration |
| Too Short | 3 | 1 |
| Too Short | 3 | 2 |
| Too Short | 3 | 3 |
| Rust | 1 | 1 |
| Brittle | 1 | 1 |
Bump | 2 | 1 |
| Bump | 2 | 2 |
| Rust | 4 | 2 |
| Rust | 4 | 3 |
| Rust | 4 | 4 |
| Rust | 4 | 5 |
Solved! Go to Solution.
You can copy the solution here in PowerQuery, which I recommend over trying to do the same thing in DAX - https://community.fabric.microsoft.com/t5/Desktop/Table-TransformColumns-repeat-rows-n-times-and-add...
Hi @carlin93
Based on your needs, I have created the following table.
Create a new custom column by using the following code in power query:
= List.Numbers(1, [value])
Then click "Expand to New Rows".
Click "Close and Apply".
This is the result you want.
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @carlin93
Based on your needs, I have created the following table.
Create a new custom column by using the following code in power query:
= List.Numbers(1, [value])
Then click "Expand to New Rows".
Click "Close and Apply".
This is the result you want.
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you, this also helped me as well
You can copy the solution here in PowerQuery, which I recommend over trying to do the same thing in DAX - https://community.fabric.microsoft.com/t5/Desktop/Table-TransformColumns-repeat-rows-n-times-and-add...
Thank you! This helped a lot
| User | Count |
|---|---|
| 57 | |
| 44 | |
| 30 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 71 | |
| 59 | |
| 39 | |
| 22 | |
| 22 |