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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Eder_Govoni
New Member

How to filter N conditions and count how many customers they have?

Hello.

Please help me with a question, I've been looking for this solution for days.


I have the table:

Eder_Govoni_1-1688686247528.png

 

I need to filter the Blue, Green and Pink services.

Returning only the number of customers who have these values, in PWBI the card is counting all customers, for example who has the Blue services, but the idea is to filter only who has the 3 services together.

 

Eder_Govoni_0-1688685794593.png

 

I tried with calculate, with filter, keep filters, everything, everything selected, but without success.

This is just one case, but I have a project, which I want to filter N possibilities, for example, Blue with Pink, or Orange with Indigo, in short, I need a formula that is adaptable.

1 ACCEPTED SOLUTION

My friend, thank you very much.

I could never think this way, it helped me a lot!

View solution in original post

4 REPLIES 4
Nathaniel_C
Community Champion
Community Champion

Hi @Eder_Govoni ,
Would you copy and paste this table rather than add a picture.  We might be able to give you a solution.

 

Thank you,
If you would share your pbix, or dummy up some values in Excel both for current and expected data. Please copy and paste them into your post, rather than doing a picture, we may be able to help you. 

Please read this post to get your question answered more quickly:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi @Eder_Govoni ,

 

Please try this measure:

test = 
VAR __SelectedServices = ALLSELECTED('Case Client'[Service])
VAR __ServiceCount = COUNTROWS(__SelectedServices)
RETURN
CALCULATE (
    DISTINCTCOUNT ( 'Case Client'[Client] ),
    FILTER (
        ADDCOLUMNS (
            VALUES ( 'Case Client'[Client] ),
            "ServiceCount", CALCULATE (
                COUNTROWS ( 'Case Client' ),
                'Case Client'[Service] IN __SelectedServices
            )
        ),
        [ServiceCount] = __ServiceCount
    )
) + 0

 

vcgaomsft_0-1688958434949.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

My friend, thank you very much.

I could never think this way, it helped me a lot!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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