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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Jagadish_Prasad
New Member

Displaying Number of Records in Card Visual Based on Parameter Filed Slicer Selection

Dear Power BI Community, @PowerBI 

I hope this message finds you well. I am reaching out because I am seeking assistance with a specific task in Power BI.

I am working on a project where I need to display the number of records from a table in a card visual, and I would like this count to dynamically change based on a slicer selection from a parameter field.

Could you please provide guidance or assistance on how to achieve this functionality in Power BI?

Thank you in advance for your help and support.

Best regards,
Jagadish Prasad

2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @Jagadish_Prasad 
The measure to achieve a goal is simple:

wanted measure = countrows ('your_table'), it will work with the slicers context.
According to the field parameters, please 

provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

AnalyticsWizard
Solution Supplier
Solution Supplier

@Jagadish_Prasad 

 

Certainly! Here’s the revised approach with additional spacing:

 

1. Create a Dynamic Filter Measure:
Develop a DAX measure that will manage the filtering based on the selected Production Role. This measure will determine whether to display rows in your report depending on whether the 'Intern' role contains null values.

```DAX
Role Filter =
VAR SelectedRole = SELECTEDVALUE('Assignment'[Production Role])
RETURN
IF(
SelectedRole = "Intern",
IF(
ISBLANK('Assignment'[Intern Name]),
BLANK(),
1
),
1
)
```

This measure checks if the selected role is "Intern" and if the 'Intern Name' is blank. If both conditions are met, it filters out the row by returning BLANK(); otherwise, it keeps the row.

 

2. Apply the Measure in Your Visuals:
Place the "Role Filter" measure as a filter in your table and card visuals. Set this filter to show items when the value is 1. This configuration will hide rows for null 'Intern' names when "Intern" is selected and will not affect the display of other roles.

 

3. Test the Setup:
After implementing the measure, test your dashboard by selecting different roles from your field parameter slicer. This will help ensure that the table and cards are responding correctly to the role selection, particularly filtering out the assignments without an 'Intern' only when that role is selected.

This approach will help maintain the dynamic and interactive quality of your dashboard, ensuring data is displayed appropriately based on user-selected criteria. If you encounter any issues or have additional requests, feel free to reach out for more assistance!

View solution in original post

2 REPLIES 2
AnalyticsWizard
Solution Supplier
Solution Supplier

@Jagadish_Prasad 

 

Certainly! Here’s the revised approach with additional spacing:

 

1. Create a Dynamic Filter Measure:
Develop a DAX measure that will manage the filtering based on the selected Production Role. This measure will determine whether to display rows in your report depending on whether the 'Intern' role contains null values.

```DAX
Role Filter =
VAR SelectedRole = SELECTEDVALUE('Assignment'[Production Role])
RETURN
IF(
SelectedRole = "Intern",
IF(
ISBLANK('Assignment'[Intern Name]),
BLANK(),
1
),
1
)
```

This measure checks if the selected role is "Intern" and if the 'Intern Name' is blank. If both conditions are met, it filters out the row by returning BLANK(); otherwise, it keeps the row.

 

2. Apply the Measure in Your Visuals:
Place the "Role Filter" measure as a filter in your table and card visuals. Set this filter to show items when the value is 1. This configuration will hide rows for null 'Intern' names when "Intern" is selected and will not affect the display of other roles.

 

3. Test the Setup:
After implementing the measure, test your dashboard by selecting different roles from your field parameter slicer. This will help ensure that the table and cards are responding correctly to the role selection, particularly filtering out the assignments without an 'Intern' only when that role is selected.

This approach will help maintain the dynamic and interactive quality of your dashboard, ensuring data is displayed appropriately based on user-selected criteria. If you encounter any issues or have additional requests, feel free to reach out for more assistance!

Ritaf1983
Super User
Super User

Hi @Jagadish_Prasad 
The measure to achieve a goal is simple:

wanted measure = countrows ('your_table'), it will work with the slicers context.
According to the field parameters, please 

provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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