Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
nidish
Regular Visitor

Need Help Migrating Tableau Report and Alteryx Workflow to Power BI

Hello,
I am currently working on migrating a complete Tableau report into Power BI. The Tableau report is connected to an Alteryx workflow, which outputs data in .yxdb format. My goal is to fully replicate both the Tableau report and the underlying Alteryx data preparation logic within Power BI.

The challenge is that the Alteryx workflow includes several multi-row formulas, and I need to reproduce this logic entirely within Power Query (M language), without using DAX or external tools.

Has anyone here successfully converted complex Alteryx workflows (especially those using multi-row calculations) into Power Query steps? Any guidance, best practices, or examples would be greatly appreciated.
Attached 2 sample multi row formulas that is used in alteryx workflows Thanks in advance!
1. [Row-1:Index]+1
2.If [Row-1:ID]=[ID] && [Row-1:Group A]=[Group A]
then
[Row-1:Extract Date]
else
Null()
endif

2 ACCEPTED SOLUTIONS
Akash_Varuna
Super User
Super User

Hi @nidish Use Table.AddIndexColumn to add indices and Table.Buffer to reference previous rows. For formulas like [Row-1:Index]+1, create an index column and add 1 to shift values. For conditional logic, use if...then...else with buffered tables to compare and derive values from prior rows. Break complex workflows into smaller steps for clarity and performance.

View solution in original post

v-veshwara-msft
Community Support
Community Support

Hi @nidish ,

Thanks for using Microsoft Fabric Community and sharing your scenario.

Yes, it’s possible to replicate Alteryx multi-row formulas using Power Query without relying on DAX or external tools. To handle logic like [Row-1:Index] + 1 or conditional row comparisons, you can use an index column and a shifted self-join approach.

I tested the logic using this sample data:

vveshwaramsft_0-1750934997054.png

Power Query steps used:

let
    Source = Table.FromRows(
        {
            {"1", "A", "X", "01-01-2024"},
            {"2", "A", "X", "02-01-2024"},
            {"3", "A", "Y", "03-01-2024"},
            {"4", "B", "X", "04-01-2024"},
            {"5", "B", "X", "05-01-2024"}
        },
        {"Index", "ID", "Group A", "Extract Date"}
    ),

    ChangedType = Table.TransformColumnTypes(Source, {
        {"Index", Int64.Type}, {"ID", type text},
        {"Group A", type text}, {"Extract Date", type date}
    }),

    AddedRowNumber = Table.AddIndexColumn(ChangedType, "RowNumber", 0, 1, Int64.Type),
    PrevRows = Table.AddIndexColumn(ChangedType, "RowNumber", 1, 1, Int64.Type),
    RenamedPrev = Table.RenameColumns(PrevRows, {
        {"Index", "Prev_Index"},
        {"ID", "Prev_ID"},
        {"Group A", "Prev_Group A"},
        {"Extract Date", "Prev_Extract Date"}
    }),

    Merged = Table.NestedJoin(AddedRowNumber, {"RowNumber"}, RenamedPrev, {"RowNumber"}, "PrevRow", JoinKind.LeftOuter),
    Expanded = Table.ExpandTableColumn(Merged, "PrevRow", {
        "Prev_Index", "Prev_ID", "Prev_Group A", "Prev_Extract Date"
    }),

    AddedIndexPlus1 = Table.AddColumn(Expanded, "Row-1_IndexPlus1", each if [Prev_Index] <> null then [Prev_Index] + 1 else null, Int64.Type),
    AddedConditional = Table.AddColumn(AddedIndexPlus1, "Conditional Extract Date", each
        if [Prev_ID] = [ID] and [Prev_Group A] = [Group A] then [Prev_Extract Date] else null, type nullable date),
    #"Sorted Rows" = Table.Sort(AddedConditional,{{"Index", Order.Ascending}})
in
    #"Sorted Rows"

 

Some best practices to keep in mind while implementing multi-row logic in Power Query:

  1. Filter and remove unnecessary columns early to optimize performance

  2. Use Table.Buffer for small lookup tables before merges, if reused

  3. Clean and standardize key columns before joining

  4. Perform merges and sorts later in the query chain when possible

Here are some resources which you might find useful:
Power Query - Methods to Refer to Previous Row - T... - Microsoft Fabric Community

Best practices when working with Power Query - Power Query | Microsoft Learn

 

Hope this helps. Please reach out for further assistance.
If this post helps, then please consider to Accept as the solution to help the other members find it more quickly.


Thank you.

Please find the attached .pbix file for reference.

 

View solution in original post

5 REPLIES 5
v-veshwara-msft
Community Support
Community Support

Hi @nidish ,
We wanted to kindly follow up regarding your query. If you need any further assistance, please reach out.
Thank you.

v-veshwara-msft
Community Support
Community Support

Hi @nidish ,

Following up to see if your query has been resolved and if any of the responses helped.

If you need further assistance, feel free to reach out.

Thank you.

v-veshwara-msft
Community Support
Community Support

Hi @nidish ,

Thanks for using Microsoft Fabric Community and sharing your scenario.

Yes, it’s possible to replicate Alteryx multi-row formulas using Power Query without relying on DAX or external tools. To handle logic like [Row-1:Index] + 1 or conditional row comparisons, you can use an index column and a shifted self-join approach.

I tested the logic using this sample data:

vveshwaramsft_0-1750934997054.png

Power Query steps used:

let
    Source = Table.FromRows(
        {
            {"1", "A", "X", "01-01-2024"},
            {"2", "A", "X", "02-01-2024"},
            {"3", "A", "Y", "03-01-2024"},
            {"4", "B", "X", "04-01-2024"},
            {"5", "B", "X", "05-01-2024"}
        },
        {"Index", "ID", "Group A", "Extract Date"}
    ),

    ChangedType = Table.TransformColumnTypes(Source, {
        {"Index", Int64.Type}, {"ID", type text},
        {"Group A", type text}, {"Extract Date", type date}
    }),

    AddedRowNumber = Table.AddIndexColumn(ChangedType, "RowNumber", 0, 1, Int64.Type),
    PrevRows = Table.AddIndexColumn(ChangedType, "RowNumber", 1, 1, Int64.Type),
    RenamedPrev = Table.RenameColumns(PrevRows, {
        {"Index", "Prev_Index"},
        {"ID", "Prev_ID"},
        {"Group A", "Prev_Group A"},
        {"Extract Date", "Prev_Extract Date"}
    }),

    Merged = Table.NestedJoin(AddedRowNumber, {"RowNumber"}, RenamedPrev, {"RowNumber"}, "PrevRow", JoinKind.LeftOuter),
    Expanded = Table.ExpandTableColumn(Merged, "PrevRow", {
        "Prev_Index", "Prev_ID", "Prev_Group A", "Prev_Extract Date"
    }),

    AddedIndexPlus1 = Table.AddColumn(Expanded, "Row-1_IndexPlus1", each if [Prev_Index] <> null then [Prev_Index] + 1 else null, Int64.Type),
    AddedConditional = Table.AddColumn(AddedIndexPlus1, "Conditional Extract Date", each
        if [Prev_ID] = [ID] and [Prev_Group A] = [Group A] then [Prev_Extract Date] else null, type nullable date),
    #"Sorted Rows" = Table.Sort(AddedConditional,{{"Index", Order.Ascending}})
in
    #"Sorted Rows"

 

Some best practices to keep in mind while implementing multi-row logic in Power Query:

  1. Filter and remove unnecessary columns early to optimize performance

  2. Use Table.Buffer for small lookup tables before merges, if reused

  3. Clean and standardize key columns before joining

  4. Perform merges and sorts later in the query chain when possible

Here are some resources which you might find useful:
Power Query - Methods to Refer to Previous Row - T... - Microsoft Fabric Community

Best practices when working with Power Query - Power Query | Microsoft Learn

 

Hope this helps. Please reach out for further assistance.
If this post helps, then please consider to Accept as the solution to help the other members find it more quickly.


Thank you.

Please find the attached .pbix file for reference.

 

Hi @nidish ,
Just wanted to check if the response provided was helpful. If yes, please consider marking it as "Accepted Solution" to assist others with similar queries. If further assistance is needed, please reach out.
Thank you.

Akash_Varuna
Super User
Super User

Hi @nidish Use Table.AddIndexColumn to add indices and Table.Buffer to reference previous rows. For formulas like [Row-1:Index]+1, create an index column and add 1 to shift values. For conditional logic, use if...then...else with buffered tables to compare and derive values from prior rows. Break complex workflows into smaller steps for clarity and performance.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.