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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
jovendeluna21
Helper IV
Helper IV

Distinct Count of Supplier Name based on Concatenated BU and Part

Hi,

Anyone can help me on this?

I am trying to assigned the sourcing type for the BUPart Concat based on the distinct count of Parent Supplier Name Cleaned.

 

I have this calculated column however it doesn't give me correct result.

 

Sourcing Type =
VAR ParentSupplierCount =
        CALCULATE(
            DISTINCTCOUNT(Sheet1[Parent Supplier Name (Cleaned)]),
            ALLEXCEPT(Sheet1,Sheet1[BUPart Concat],Sheet1[MonthYear],Sheet1[Is Inter-Company Supplier])
        )
    RETURN
        IF(
            ParentSupplierCount > 1,
            "Multi-sourced",
            "Single-sourced"
        )
 
For example, DISC109-162-8654 should be Multi-sourced only but it gives both Single-sourced and multi-sourced.
Then for DISC2122006140 should be Multi-sourced since it has more than 1 distinct Parent Supplier Name.
 
Then I have a MonthYear and Is Inter-Company Supplier filter that will affect the result. Since the BUPart Concat can be multi-sourced or single-sourced on previous months.
 
The sourcing type should be a column instead of a measure because I will use the sourcing type as legend for my charts.

 

ssfg.PNG

 

Here's the link to the pbi file:

https://drive.google.com/file/d/1PBqyg_QJTmpoDWXqmMpVxR8T6RJywVlk/view?usp=sharing

4 REPLIES 4
jovendeluna21
Helper IV
Helper IV

The goal is when I visualize that in a chart it will show as multi-sourced only as a whole, considering on the selected multiple months that BUPart Concat have two distinct Parent Supplier Name

Ahmedx
Super User
Super User

everything is in order, the same result should be at the level of the month

you can remove the month if you want:

Sourcing Type = 
VAR ParentSupplierCount =
        CALCULATE(
            DISTINCTCOUNT(Sheet1[Parent Supplier Name (Cleaned)]),
            ALLEXCEPT(Sheet1,Sheet1[BUPart Concat],Sheet1[Is Inter-Company Supplier])
        )
    RETURN
        IF(
            ParentSupplierCount > 1,
            "Multi-sourced",
            "Single-sourced"
        )

Screen Capture #1311.png

What if regardless of the month, the result should be multi-sourced? How can I do that? 

I wrote to you above, you should write like this

ALLEXCEPT(Sheet1,Sheet1[BUPart Concat],Sheet1[Is Inter-Company Supplier])

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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