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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
blur2teoh
Frequent Visitor

Calculate Distinct Count for Customer exclude Customer Name consist of "GOL -"

Hello,
i would like to calculate the number of customer based on customer code but exclude those customer name consist of "GOL -". May i know am i missing anything in the measurement?
blur2teoh_0-1712907825530.png

 

1 ACCEPTED SOLUTION
quantumudit
Continued Contributor
Continued Contributor

You can create a DAX measure as follows:

 

Omni_No. of Customers = 
CALCULATE(
    DISTINCTCOUNT('Omni Sales Data'[Customer Code]),
    FILTER(
        ALL('Omni Sales Data'),
        LEFT('Omni Sales Data'[Customer Name] , 3) <> "GOL"
    )
)

This measure calculates the distinct customer code, excluding customers with "GOL" prefix. Here is the  solution screenshot:

quantumudit_0-1712925448623.png

As you can see, I have total 6 disticnt customers (ID is unique), but, 4 customers without the "GOL" prefix (as expected). Let me know if this solved your issue. 

Best Regards,
Udit

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree


View solution in original post

2 REPLIES 2
quantumudit
Continued Contributor
Continued Contributor

You can create a DAX measure as follows:

 

Omni_No. of Customers = 
CALCULATE(
    DISTINCTCOUNT('Omni Sales Data'[Customer Code]),
    FILTER(
        ALL('Omni Sales Data'),
        LEFT('Omni Sales Data'[Customer Name] , 3) <> "GOL"
    )
)

This measure calculates the distinct customer code, excluding customers with "GOL" prefix. Here is the  solution screenshot:

quantumudit_0-1712925448623.png

As you can see, I have total 6 disticnt customers (ID is unique), but, 4 customers without the "GOL" prefix (as expected). Let me know if this solved your issue. 

Best Regards,
Udit

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree


If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

 

Thanks,

Udit

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.