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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
AutoJL
Helper II
Helper II

Choosing between count and distinct count in visual with slicer

Hi Fellow Community!

I need some assistance with a "seemingly easy" task. I have some visuals built in a report that use one column of my dataset. This column contains ID values which can be duplicates. I would like to be able to use the visual with the normal count or with the distinct count toggling between them with the help of a slicer (Similarly to what field parameters do).

 

Any ideas on how to achieve this?

Many thanks!

1 ACCEPTED SOLUTION
AutoJL
Helper II
Helper II

Hello!

 

Finally i was giving this some tries and realized I was overthinking it. There is a very easy solution! The basic idea is not to use the default columns from the dataset and then selecting in the visualization Field panel but rather using DAX measures:

I have created 2 measures with DAX: the count and the distinctcount of the column that I wanted. Then with those  have created a field parameter with which I can build a slicer and use in the any visual.

 

Many thanks and hope it helps!

View solution in original post

1 REPLY 1
AutoJL
Helper II
Helper II

Hello!

 

Finally i was giving this some tries and realized I was overthinking it. There is a very easy solution! The basic idea is not to use the default columns from the dataset and then selecting in the visualization Field panel but rather using DAX measures:

I have created 2 measures with DAX: the count and the distinctcount of the column that I wanted. Then with those  have created a field parameter with which I can build a slicer and use in the any visual.

 

Many thanks and hope it helps!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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