Dynamic Groupings - Why Use CountRows?

Hi All

I am trying to learn more about the Dynamic Groupings method and have rewatched the below video a couple of times.

I understand this when it is done through calculated columns (this is like a lookup in Excel where I want to identify what group this is based on the unit price).

However, once its in a DAX formula, I don’t understand the role of the COUNTROWS. Wouldn’t the result be 1 as we iterate each unit price? At what point, are we ‘looking up’ the pricing groups against each price?

Thanks!

@swong12 Separate the code into variables and then it is easier to understand what is happening.

3 Likes

Many thanks @AntrikshSharma for your suggestion.

I am still learning and I guess breaking this up is so important!

Thanks again @AntrikshSharma

I have tried to visualize this in Excel and am confused by the last part where FILTER returns a list of values for filter context.

Taking my example below (Country A), I have highlighted the final result in green. At which point, does this formula identify the category as “Top”?

image

FILTER FUNCTION.xlsx (10.1 KB)

Bumping this post for more visibility to other users and experts. :slight_smile:

Hi @swong12 - This is already explained in detail by Antriksh. This is a nested Filter condition, Second Filter condition will be executed for each unit price and for whatever records the Unit Price is between High and Low values of Top Category will be selected.

Finally [Total Sales] will return Sales values considering all those records that comes under Top Category.

Can also go through below Blog for detailed explanation.

Thanks
Ankit J

Hello @swong12, just following up if the responses above help you solve your inquiry?

We’ve noticed that no response has been received from you since a few days ago. In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.