Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!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.
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.
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
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!
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.
Proud to be a 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.
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
Check out the May 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
74 | |
72 | |
71 | |
50 | |
45 |
User | Count |
---|---|
46 | |
38 | |
29 | |
28 | |
28 |