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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.