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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
LLGreen
Frequent Visitor

Count the number of table visual rows after user excludes a row

I have a page in a Power BI report with a table visual (7 columns) that is filtered by three page-level filters and two report-level filters (in the Filters pane). Above that is a card visual that shows the number of rows in the table visual (it counts the number of rows in the data table that fit two criteria). Some users have been editing the table visual by right-clicking on rows they don't want and choosing "Exclude", which removes the row from the table visual (setting up a visual-level filter that excludes all the combined column values from the that row); however, the card visual still shows the count based on the data table. For example, the table visual starts with five rows, and the card visual shows 5. The user then "Exclude"s one row, leaving only four showing in the table visual, but the card visual still says 5.

 

Is there a way to count only the number of rows that are visible in the table visual, and not the count from the filtered data table? I've tried various combinations of CALCULATE, COUNTROWS, and ALLSELECTED, but to no avail.

11 REPLIES 11
v-sgandrathi
Community Support
Community Support

Hi @LLGreen,

 

Thank you for confirming. It's good to know you used a page-level filter, as this helps keep visuals consistent and avoids issues with the Exclude action.

Applying a page-level filter keeps the table and card visuals aligned under the same filter context. Advising users not to manually exclude rows also helps prevent mismatched counts from visual-level filters.

I'm glad everything is working well now. Let me know if you have any questions or would like to discuss other options like slicers or bookmarks in the future.

 

Thank you.

v-sgandrathi
Community Support
Community Support

Hi @LLGreen,


Try these approches:
Replace “Exclude” with a user-controlled slicer or flag column
Add an “IncludeFlag” column (default = 1) in your dataset.
Let users toggle visibility via a slicer:
Visible Row Count :=
CALCULATE(
    COUNTROWS(YourTable),
    YourTable[IncludeFlag] = 1
)
Both the table and card will now respect this filter automatically.

Use Field Parameters or Bookmarks for filtering
You can create a parameterized view of your table or save specific filtered states using bookmarks.
This lets users hide or show rows interactively without relying on “Exclude,” while keeping the card and table synchronized.

Show the count inside the table visual
If you only need the count for reference, you can add a measure column or total row in the table visual itself.
This will reflect the exclusions because it’s calculated inside the same visual context.

Thank you.

That's basically what I did. I ended up using a page-level filter and instructed the user not to Exclude individual rows.

v-sgandrathi
Community Support
Community Support

Hi @LLGreen,

 

Thank you @danextian@ryan_mayu @lbendlin  @Praful_Potphode  for your responses to the query and the contribution.

Just wanted to follow up and confirm that everything has been going well on this. Please let me know if there’s anything from our end.
Please feel free to reach out Microsoft fabric community forum.

No, sorry. None of the suggestions helped. I ended up using a page-level filter and instructing the user not to Exclude individual rows.

Praful_Potphode
Resolver III
Resolver III

Hi @LLGreen 

to propogate the filter to the card visual, try using  ISFILTERED/VALUES/TREATAS/SELECTEDVALUE DAX combination to create your card value.what this will do is when you exlcude something ,these dax functions will check the current filter state and then return the count.

PLease give kudos or mark it as solution once confirmed.

Thanks and Regards,

Praful

Can you give me an example of how you would set this up?

lbendlin_0-1761255875138.pnglbendlin_1-1761255904006.png

 

 

danextian
Super User
Super User

Hi @LLGreen 

 

You can count the number of rows a table visual returns by creating a virtual table of the columns the visual has. Below is an example

danextian_0-1761194276111.pngHowever, unless the card is cross-highlighted and/or there is a slicer selection that can affect both visuals, the value in the card won't update as the the filter as applied to the visual only - excluding/including a row creates a visual not page level filter.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
ryan_mayu
Super User
Super User

@LLGreen 

when you do the exclude action in the table visual, that means you will add a table visual filter. So the visual level filter will only affect that visual. If you want to affect other visuals, it's better to add a slicer and ask users to select in that slicer. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




lbendlin
Super User
Super User

You will need to experiment with the FILTERS() function  to have a chance at this.

 

FILTERS function (DAX) - DAX | Microsoft Learn

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors