Uploaded March 2025 | Updated November 2026, 23 hours ago
A Power Query PRO trick to help us clean and "automatically tag" data based on a rules table. This time-saving automation has been helping me a lot with "rules-based text classification" and I am excited to share it with you.
What you are going to learn π‘
========================
1) The challenge of "tagging" or "categorization" based on rules table.
2) Using Text.Contains and the limitation
3) Introducing "loops" βΎοΈ in Power Query with List.Accumulate()
4) Using List.Accumulate with a custom function
5) How to convert our rules logic into an invokable M function for future uses
6) Enhancement ideas
Sample file π
============
chandoo.org/wp/wp-content/uploads/2025/03/expense-categorization.xlsx
Video Timestamps π
===================
0:00 - The ultimate Power Query time-saver trick
1:20 - Loading the data into Power Query
2:20 - Solving for one line item - understanding the logic
4:01 - Using Text.Contains and the limitation
4:55 - List.Accumulate - What is it and how to use it
11:30 - Converting the logic to a Power Query function
19:25 - Ways to enhance the functionality
π°$50 Discount on My Power Query, Power Pivot & Power BI course π€
==========================================================
If you like this magic show, you are going to LOVE my online, self-paced Power BI course. It helps you unlock the hidden powers & secrets of Power Query, M language, Power Pivot, DAX & Power BI report building. Visit chandoo.org/wp/power-bi-course
Use Coupon code SAVE50 to get $50 (or Rs 3,000) discount.
~
#powerquery #chandoo
A Power Query PRO trick to help us clean and "automatically tag" data based on a rules table. This time-saving automation has been helping me a lot with "rules-based text classification" and I am excited to share it with you.
What you are going to learn π‘
========================
1) The challenge of "tagging" or "categorization" based on rules table.
2) Using Text.Contains and the limitation
3) Introducing "loops" βΎοΈ in Power Query with List.Accumulate()
4) Using List.Accumulate with a custom function
5) How to convert our rules logic into an invokable M function for future uses
6) Enhancement ideas
Sample file π
============
chandoo.org/wp/wp-content/uploads/2025/03/expense-categorization.xlsx
Video Timestamps π
===================
0:00 - The ultimate Power Query time-saver trick
1:20 - Loading the data into Power Query
2:20 - Solving for one line item - understanding the logic
4:01 - Using Text.Contains and the limitation
4:55 - List.Accumulate - What is it and how to use it
11:30 - Converting the logic to a Power Query function
19:25 - Ways to enhance the functionality
π°$50 Discount on My Power Query, Power Pivot & Power BI course π€
==========================================================
If you like this magic show, you are going to LOVE my online, self-paced Power BI course. It helps you unlock the hidden powers & secrets of Power Query, M language, Power Pivot, DAX & Power BI report building. Visit chandoo.org/wp/power-bi-course
Use Coupon code SAVE50 to get $50 (or Rs 3,000) discount.
~
#powerquery #chandoo










