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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Measure to get number of rows in a table with crossfiltering

Hello,

Lets say I have a table called dim_clusters and another called dim_countries.
Clusters have a relationship with countries, and selecting a cluster on a slicer/filter will filter the dim_countries table

 

I am trying to create a measure, that will tell me how many countries it exists based on a slicer selection.
I used the LEN,calculatetable,filter,values but I can never get the right number...

Either I get the number of all rows or the number of rows that I select directly on dim_country slicer.

It should ignore the filter applied on dim_country, but it should take into consideration filters applied on dim_clusters table.

How can I achieve this?

Thank you!

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

here you will find a little PBIX

 

Not sure if I understand your requirement correctly, but from my point of view this report look quite good:

 

image.png

 

I created this DAX statement

No = 
CALCULATE( 
    COUNTROWS(
        'Country'
    )
    ,ALL('Country'[Country])
    ,VALUES('Country'[Cluster])
)

The measure results to 2 due to the fact, that the slicer from the country column reduces the the country table and there are just 2 countries in the same cluster as the filtered country Germany.

 

Hope this is what you are looking for

 

Regards

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

 

here you will find a little PBIX

 

Not sure if I understand your requirement correctly, but from my point of view this report look quite good:

 

image.png

 

I created this DAX statement

No = 
CALCULATE( 
    COUNTROWS(
        'Country'
    )
    ,ALL('Country'[Country])
    ,VALUES('Country'[Cluster])
)

The measure results to 2 due to the fact, that the slicer from the country column reduces the the country table and there are just 2 countries in the same cluster as the filtered country Germany.

 

Hope this is what you are looking for

 

Regards

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Yes, this solution works :).

Thank you.
Cheers!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.