Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
How to calculate rows on a table? I want to create a column "started" as below, for each row of this column I need the result of this excel like formula: =IF(AND(A3=A2;B3-B2<1);"No";"yes")
part | install date | started |
PAU-0101 | 26/03/2019 05:17 | yes |
PAU-0101 | 07/04/2019 18:56 | No |
PAU-0101 | 07/04/2019 19:56 | yes |
PAU-0102 | 26/03/2019 05:17 | yes |
PAU-0102 | 07/04/2019 18:56 | No |
PAU-0102 | 07/04/2019 19:56 | yes |
@edgarjb-68 , try like
Column = var _next = minx(filter(Sheet1,[part] =EARLIER([part]) && [install date] >EARLIER(Sheet1[install date])),[install date])
return if(DATEDIFF([install date],_next,day)<1 && NOT(ISBLANK(DATEDIFF([install date],_next,day))),"No","Yes")
File attached after signature
you can edit your table in power query:
#"Sorted Rows" = Table.Sort(#"Changed Type",{ {"part", Order.Ascending},{"install date", Order.Ascending}}),
#"Added Index" = Table.AddIndexColumn(#"Sorted Rows", "Index", 1, 1),
#"Added Custom" = Table.AddColumn(#"Added Index", "next part", each #"Added Index"{[Index]+0}[part]),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "next date", each #"Added Custom"{[Index]+0}[install date]),
#"Added Conditional Column" = Table.AddColumn(#"Added Custom1", "check", each if [part] = [next part] and Date.AddDays([install date],1) > [next date] then "NO" else "YES"),
#"Replaced Errors" = Table.ReplaceErrorValues(#"Added Conditional Column", {{"check", "YES"}})
I'm sure there is an way to do this with less lines... but at least this should do the trick
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |