Live training: next batches coming soon. Join the waitlist:Waitlists open:Developer Training →Developer →Copilot Studio Training →Copilot Studio →

Best Way to Count Rows and Distinct Values in Power BI Power Query

Last week, one of my subscribers asked me a question about Power Query in Power BI. He was working with a Product table that has three columns: Product Key, Date, and Sold. For one Product Key, there are many records with different dates.

The requirement was simple. He wanted to count how many times the value “YES” appears in the Sold column for each Product Key.

To do this, Power Query provides a Group By option that lets us count rows and perform a distinct count with just a few clicks.

In this tutorial, I will show you how to add a column to count rows and how to add a column for distinct count using Power Query. You will see that this can be done in just four clicks by using the Group By feature in Power BI Power Query.