Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I am trying to make a for loop in power query but I am unable to.
I need to create a new column that accumulates +1 if for the same employee and successive dates and situation="abs" increments its value by 1 otherwise it would have to restart at 0.
I have tried List.Generate, but I don't know how to implement it in a column.
it's hard to do this with Table.AddColumn, suggest you to add a new step with this code
NewStep=Table.FromRecords(List.Accumulate(Table.ToRecords(PreviousStepName),{{},"",0,0},(x,y)=>if y[Empoyee]=x{1} and y[Situation]="ABS" and y[Date]=Date.AddDates(x{2},1) then {x{0}&{y&[LD=x{3}+1]},y[Employee],y[Date],x{3}+1} else {x{0}&{y&[LD=Byte.From(y[Situation]="ABS")]},y[Employee],y[Date],Byte.From(y[Situation]="ABS")}){0})
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
14 | |
13 | |
12 | |
12 | |
12 |