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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Z_BI
Frequent Visitor

Card with counter from Object Table

Hello community,
in a report I have a date filter, a user filter and a Table visual object that contains columns and measures from different tables.
The date filter and user filter act on the context of the Table object.
I would need to create a card that counts how many records there are inside the Table visual object.

 

4 REPLIES 4
Anonymous
Not applicable

Hi @Z_BI ,

 

How is the situation now? If the question has been solved, please accept any responses you find useful as a solution. If you want another method, please provide more details about your requirement.

 

 

Best regards,

Mengmeng Li

PavanLalwani
Resolver II
Resolver II

To create a card that dynamically counts the number of records visible in your **Table visual** (based on the active date and user filters), you can use DAX to create a measure that reflects the count of records in the context of the applied filters. Here’s how you can do it:

### Step-by-Step Solution

1. **Create a Measure for Counting Records**
Create a new measure that will count the rows in the table based on the current filter context.

```DAX
RecordCount = COUNTROWS('YourTable')
```

> Replace `'YourTable'` with the name of the main table used in the Table visual.

2. **Place the Measure in a Card Visual**
- Go to your **Report view** in Power BI.
- Insert a **Card visual**.
- Add the `RecordCount` measure to the Card.

This will display the total count of rows currently visible in the Table visual, respecting any filters applied through the **Date** and **User** slicers.

3. **Ensure Filters are Applied Correctly**
- Make sure that the Date and User filters are properly linked to the table in the data model.
- If the Date or User fields are from different tables, ensure that there is a relationship between them and your main table, so the filters can flow through and affect the `RecordCount` measure correctly.

### Alternative: Using a DISTINCTCOUNT if Needed
If you need to count unique values in a specific column rather than all rows, use `DISTINCTCOUNT` instead of `COUNTROWS`:

```DAX
UniqueRecordCount = DISTINCTCOUNT('YourTable'[YourColumn])
```

> Replace `'YourTable'[YourColumn]` with the relevant table and column.

This approach will allow your card to dynamically reflect the number of records displayed in the Table visual based on the filter context, giving you an accurate record count that updates with the filters.

If this solution brightened your path or made things easier, please consider giving kudos. Your recognition not only uplifts those who helped but inspires others to keep contributing for the good of our community!

Idrissshatila
Super User
Super User

Hello @Z_BI,

 

then you need to create a measure that as a virtual table in it that represents the fields with the measures with the applied filters and on top of this virtual table you use countrows of this table.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




shafiz_p
Super User
Super User

Hi @Z_BI  Create a measure to count rows:

 

Record Count = COUNTROWS('YourTable')

 

Replace 'YourTable' with the name of the table you are using in your visual.

 

  • Go to your report in Power BI.
  • Add a new Card visual to your report.
  • Drag the Record Count measure to the Card visual.

This measure will count the number of records in the Table visual, respecting the date and user filters applied.

 

Hope this helps!!

If this solved your problem, please accept it as a solution!!

 

 

Best Regards,
Shahariar Hafiz

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.