-1

My csv file have one column with multiple rows.

I read that file in power bi desktop and try to display as paginated report .

The design I want to display is I like to show every 10 record as one page so I want to add same index for every 10 row and increase 1 and so on . So that I can group by that index and combine text .

Then I can show as one page in paginated report.

I like to know how can I add same index columns for every 10 row in power bi query?

1 Answer 1

0
let
    Source = Csv.Document(
        File.Contents("C:\path\to\your.csv"),
        [Delimiter=",", Columns=1, Encoding=1252, QuoteStyle=QuoteStyle.None]
    ),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Added Index" = Table.AddIndexColumn(#"Promoted Headers", "Index", 1, 1),
    #"Added Batch" = Table.AddColumn(
        #"Added Index",
        "Batch",
        each Number.IntegerDivide([Index] - 1, 10) + 1,
        Int64.Type
    ),
    #"Removed Index" = Table.RemoveColumns(#"Added Batch", {"Index"})
in
    #"Removed Index"
Sign up to request clarification or add additional context in comments.

3 Comments

How does this address the issue? Please edit your answer and explain the changes you've made to solve the problem.
Thank for your answer. I have additional question. Let say this time have one more column which have value 1 and empty string. Becoz I don’t want to set fix 10 row.I want to set same index until next 1 value is found in each .
After adding Index, add Table.AddColumn(#"Added Index", "GroupMe", each if [Test] = 1 then [Index] else null) then use the Fill Down under Transform. Then you can group on this column.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.