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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Filtered table and "linked" card

I have a filtered table in a Power BI report and want a card to show the total number of rows in the filtered table, at present I have a card in the same Power BI report and it shows a value for all unfiltered rows. The card uses a field from one table whereas the report table uses fields from several tables that have relationships - I am working with data from Project Server if that helps where there are data tables for projects, resources, assignments and more besides.

7 REPLIES 7
Anonymous
Not applicable

Hi @Anonymous ,

--I have a filtered table in a Power BI report and want a card to show the total number of rows in the filtered table
--Please create a new measure like:

Measure = COUNTROWS(ALL('YourTableName'))

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

Anonymous
Not applicable

Thanks for the suggestion, when I create the measure it recognises a table name from the data source. The Table that is displayed on the Canvass in the Report/Dashboard contains data from several tables that have relationships. The calculated measure I created returns the value of the total number of rows in the table of data in the data source not the table displayed in my Power BI Report - I have looked and cannot see a name for the table created using the Table Visual, as a result the calculated measure is not displaying the expected value.

Anonymous
Not applicable

Hi @Anonymous ,

What fields are in your table visual?
Please try this:

Measure =
COUNTROWS (
    SUMMARIZE (
        ALL ( 'Table1' ),    // Table1 should ideally be at 1 end of the relationship in the model
        'Table1'[Column1],
        'Table1'[Column1],
        'Table2'[Column3]
        ...   // Fields not aggregated in the table visual
    )
)

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

Anonymous
Not applicable

Thanks for the suggestion but Table1 is not recognised. I get this error.

 

The syntax for '.' is incorrect. (DAX(COUNTROWS ( SUMMARIZE ( ALL ( 'Table1' ), // Table1 should ideally be at 1 end of the relationship in the model 'Table1'[Column1], 'Table1'[Column1], 'Table2'[Column3] ... // Fields not aggregated in the table visual )))).

Anonymous
Not applicable

Hi @Anonymous ,

I modified the dax code.
Please try:

Measure = CALCULATE(COUNTROWS(SUMMARIZECOLUMNS('Calendar'[Month],'financials'[Country],'financials'[Product])),ALL())


The code I posted is just an example, you need to modify the code according to the actual model.
Please check the pbix file.

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

Sahir_Maharaj
Super User
Super User

Hello @Anonymous, can you please try this approach:

 

1. Create a New DAX Measure

Total Filtered Rows = COUNTROWS(FILTERED_TABLE)

 

2. Drag a card visual onto your canvas and place the measure in the card. Since you mentioned that your report table uses fields from several tables with relationships, ensure that these relationships are properly set up in the Power BI model.

 

3. Apply different filters to your report and observe how the number displayed in the card visual changes. The number should reflect the count of rows visible in the filtered table. (If you want the card to show a count of distinct values, you can use the DISTINCTCOUNT function instead of COUNTROWS)

 

Should you require any questions or further assistance, please do not hesitate to reach out to me.


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

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ About: https://sahirmaharaj.com/about.html
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
Anonymous
Not applicable

Thanks for the suggestion which was similar to the previous answer, when I create the measure it recognises a table name from the data source. The Table that is displayed on the Canvass in the Report/Dashboard contains data from several tables that have relationships. The calculated measure I created returns the value of the total number of rows in the table of data in the data source not the table displayed in my Power BI Report - I have looked and cannot see a name for the table created using the Table Visual, as a result the calculated measure is not displaying the expected value.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.