Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Power Query - How to number each column 1 to n
10-17-2023
10:24 AM
Hello,
How do I number each row of data 1 to 5? I want each row to be numbered, with no grouping etc. I just want the sequence of numbering done.
Thanks
Solved! Go to Solution.
1 ACCEPTED SOLUTION
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023
02:14 PM

Hi
Add index column, transform column modulo 5 and add 1
let
Source = YourSource,
Index = Table.AddIndexColumn(Source, "Index", 0, 1, Int64.Type),
#"Modulo5+1" = Table.TransformColumns(Index, {{"Index", each Number.Mod(_, 5)+1, Int64.Type}})
in
#"Modulo5+1"
Stéphane
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023
02:14 PM

Hi
Add index column, transform column modulo 5 and add 1
let
Source = YourSource,
Index = Table.AddIndexColumn(Source, "Index", 0, 1, Int64.Type),
#"Modulo5+1" = Table.TransformColumns(Index, {{"Index", each Number.Mod(_, 5)+1, Int64.Type}})
in
#"Modulo5+1"
Stéphane

Helpful resources
Recommendations
Subject | Author | Posted | |
---|---|---|---|
06-30-2023 02:04 AM | |||
04-25-2024 07:02 AM | |||
Anonymous
| 03-08-2024 10:58 AM | ||
Anonymous
| 03-21-2024 08:15 AM | ||
06-12-2023 04:52 AM |