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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

One client, one product, different suppliers - how to count

Hello community members,

 

I have the following issue.

 

A client (column A) can receive a product (column B) from a supplier (column C)

Column D and E are combinations of column A and B or column A, B and C

 

ClientNumberProductSupplierClientProdCombiClientProdSupplierCombi
9055A0733330618000090&&55A07000090&&55A07&&33330618
9055A0733330618000090&&55A07000090&&55A07&&33330618
24555A0784840717000245&&55A07000245&&55A07&&84840717
24555A0784840717000245&&55A07000245&&55A07&&84840717
24555A0733330618000245&&55A07000245&&55A07&&33330618
72055A0784840717000720&&55A07000720&&55A07&&84840717
72055A0784840717000720&&55A07000720&&55A07&&84840717
72055A0784840717000720&&55A07000720&&55A07&&84840717
73055A0784840717000730&&55A07000730&&55A07&&84840717
73055A0715081473000730&&55A07000730&&55A07&&15081473
135755A0733330618001357&&55A07001357&&55A07&&33330618
135755A0784840717001357&&55A07001357&&55A07&&84840717

 

Now I would like to know the following thing:  

How many clients have received a specific product from different suppliers?

 

E.g. client 1357 has received the same product (55A07) from supplier 33330618 and supplier 84840717

 

Can anyone help me with the measure ?

 

Hope to hear soon from you!

 

Best regards,

 

Sander

1 ACCEPTED SOLUTION
timg
Solution Sage
Solution Sage

Hi Sander,

This kinda depend on what you are looking for in the output. If you just want to have the number of suppliers that every customer+product has, you could try this:

CALCULATE(DISTINCTCOUNT('Table'[Supplier]); ALL('Table'[Supplier]))

 

If you would like to have a text displayed to indicate whether the client+product has >1 supplier you could try this:

DistinctSuppliers =
IF (
    CALCULATE ( DISTINCTCOUNT ( 'Table'[Supplier] ); ALL ( 'Table'[Supplier] ) ) > 1;
    "Multiple suppliers";
    "One supplier"
)

1.png

Regards,

 

Tim





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

Proud to be a Super User!




View solution in original post

1 REPLY 1
timg
Solution Sage
Solution Sage

Hi Sander,

This kinda depend on what you are looking for in the output. If you just want to have the number of suppliers that every customer+product has, you could try this:

CALCULATE(DISTINCTCOUNT('Table'[Supplier]); ALL('Table'[Supplier]))

 

If you would like to have a text displayed to indicate whether the client+product has >1 supplier you could try this:

DistinctSuppliers =
IF (
    CALCULATE ( DISTINCTCOUNT ( 'Table'[Supplier] ); ALL ( 'Table'[Supplier] ) ) > 1;
    "Multiple suppliers";
    "One supplier"
)

1.png

Regards,

 

Tim





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

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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