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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sabinocivita
Frequent Visitor

Use Distinctcount measure as filter

Hi all,

I created a measure that is a distincount of a column (ie invoice number). Now I'd like to use distintcount as a filter in a dashboard.

Example: in table object I have first column that is distinctcount of invoices and second one is the customer name. So for each customer I have number of invoices sent. 

Now I'd like to have a filter field to select only customers that have less than or more than a certain number of invoices.

How to do it?

 

Thanks!

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @sabinocivita 

You can consider creating a filter measure and then applying it to the table vissual filter pane to filter data.

visual filter =
IF (
    ISFILTERED ( 'filter field'[count] ),
    IF (
        [distinctcount of invoices] <= SELECTEDVALUE ( 'filter field'[count] ),
        1,
        0
    ),
    1
)

veasonfmsft_0-1658729450022.png

Best Regards,
Community Support Team _ Eason

View solution in original post

4 REPLIES 4
v-easonf-msft
Community Support
Community Support

Hi, @sabinocivita 

You can consider creating a filter measure and then applying it to the table vissual filter pane to filter data.

visual filter =
IF (
    ISFILTERED ( 'filter field'[count] ),
    IF (
        [distinctcount of invoices] <= SELECTEDVALUE ( 'filter field'[count] ),
        1,
        0
    ),
    1
)

veasonfmsft_0-1658729450022.png

Best Regards,
Community Support Team _ Eason

sabinocivita
Frequent Visitor

Can you please tell me how to create the group table?

You can try create calc table like this:

Calc table = SUMMARIZE ( 'Table', 'Table'[ClientID], "InvoiceCount", DISTINCTCOUNT('Table'[InvoiceID]) )

technolog
Super User
Super User

Hi! 

You can do it by different ways.

You can create group table that calculate number of invoices for different customer. And then filter it.

Also you can create new column for you table where you can calculate number of invoice for current customer.

And then filter by customer who have number of invoices > 1.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.