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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
jimforjim
New Member

How to make filter counts match distinct values

I've created a visualization with a couple of graphs and a table, along with a series of filters, that are based on a SQL Server view.  The name of the view is Visit, with each visit having a VisitID.  There is a table called Category, and each visit can have multiple categories.  I pass these categories to the view in pipe-delimited format, and use Data Transformation to split those values into rows.  Now, my category filter has the correct counts, and my table had the right rows, but the counts in the graphs and in the other filters were incorrect - it was counting the values for each VisitID/Category combo, rather than each VisitID.  I was able to fix the graphs by creating a new measure with COUNTDISTINCT, but the filters still are wrong.  How can I make the other filters count the distinct number of visits, rather than the combination of VisitID/Category?

 

Thank you!

5 REPLIES 5
jimforjim
New Member

Unfortunately, the data is confidential.  I'm hoping that this is a known pattern and a problem that has a known resolution, but if not, I may be able to mock up something.

jaideepnema
Solution Sage
Solution Sage

Can you please share a sample file if possible to check this ?

I went ahead and created a sample.  Here's a link to the PBIX.  You'll notice that there are a total of 10 visits, but that some of those visits have multiple report categories.  These reflect correctly on the pie chart and table - the pie chart is correct because I use a measure to DISTINCTCOUNT the VisitID.  However, if you look at the Filters, you can see the problem.  The Report Categories are correct, because if you select them, you get that number of items in the pie chart.  However, you'll see that the Market Segment filters are incorrect - for example, it says that there are 55 Digital Marketing visits, but if you filter by that value, you get 7 results (which is correct).

Hi @jimforjim ,

Based on your description, you want the page filter count should be the same as pie visual count right?

filter.png

If so, I'm afraid you could not acheive this in power bi currently because the count of each field in the level filters is based on the whole data table by default and we could not change it. In addition, even if we use measures, they could only be put in visual filters, page filters does not allow measures.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Unfortunately, the data is confidential. I'm hoping that the general scenario is clear, but if not, please let me know and I can probably mock something up.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.