Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I'm adding a column to a date table. The column needs to count to 20 by rows and restart.
Example:
Year Month Day BusPeriod
2013 06 13 15
2013 06 14 16
2013 06 15 17
2013 06 16 18
2013 06 17 19
2013 06 18 20
2013 06 19 1
2013 06 20 2
2013 06 21 3
2013 06 22 4
2013 06 23 5
Any suggestion on how to go about this or if this is even possible?
Solved! Go to Solution.
You can add an index column, and then transform that column into something like: Number.Mod([Index] + 1, 20)
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1), #"Calculated Factorial" = Table.TransformColumns(#"Added Index",{{"Index", (index) => Number.Mod(index, 20) + 1, type number}}) in #"Calculated Factorial"
You can add an index column, and then transform that column into something like: Number.Mod([Index] + 1, 20)
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1), #"Calculated Factorial" = Table.TransformColumns(#"Added Index",{{"Index", (index) => Number.Mod(index, 20) + 1, type number}}) in #"Calculated Factorial"
User | Count |
---|---|
75 | |
75 | |
45 | |
31 | |
27 |
User | Count |
---|---|
99 | |
89 | |
52 | |
48 | |
46 |