March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Dear PBI users, good morning.
I need a help with this issue, I would like to create a new table using dax that would repeat the value of another column based on another. To exemplify:
Current table:
Product | Pallet Quantity |
A | 3 |
B | 2 |
Desired Result:
Product | Pallet Quantity |
A | 1 |
A | 1 |
A | 1 |
B | 1 |
B | 1 |
How can I do that in DAX?
Thank you in advance!
Solved! Go to Solution.
@Anonymous Try this. PBIX is attached below signature.
Table 2 =
SELECTCOLUMNS(
ADDCOLUMNS(
GENERATE(
DISTINCT('Table'[Product]),
GENERATESERIES(1,MAXX(FILTER('Table',[Product] = EARLIER('Table'[Product])),[Pallet Quantity]),1)
),
"Pallet Quantity",1
),
"Product",[Product],
"Pallet Quanitity",[Pallet Quantity]
)
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://1drv.ms/u/s!AiUZ0Ws7G26RhjeqxmvgzEItNzcu?e=frRM7C
also possible in power query
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://1drv.ms/u/s!AiUZ0Ws7G26RhjeqxmvgzEItNzcu?e=frRM7C
Is there a way that I could include Indexes as well?
For example
Product - Pallet Quantity - Index
A - 1 - 1
A - 1 - 2
A - 1 - 3
B - 1 - 1
B - 1 - 2
@Anonymous Try this. PBIX is attached below signature.
Table 2 =
SELECTCOLUMNS(
ADDCOLUMNS(
GENERATE(
DISTINCT('Table'[Product]),
GENERATESERIES(1,MAXX(FILTER('Table',[Product] = EARLIER('Table'[Product])),[Pallet Quantity]),1)
),
"Pallet Quantity",1
),
"Product",[Product],
"Pallet Quanitity",[Pallet Quantity]
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |