Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have a Table as below
this table has some items and quantity and price columns
what I want to do is divide these items to groups where the total sum of net price for each group does not exceed 2000$ ?
you can try this code, but the efficiency is a problem
NewStep=let a=Table.AddIndexColumn(PreviousStepName,"idx"),b=List.Buffer(a[Net Value]) in Table.Group(a,"idx",{"n",each _},0,(x,y)=>Byte.From(List.Sum(List.Range(b,x,y-x+1))>=2000))
User | Count |
---|---|
102 | |
91 | |
87 | |
79 | |
71 |
User | Count |
---|---|
113 | |
105 | |
101 | |
73 | |
65 |