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
o59393
Post Prodigy
Post Prodigy

Distinct Count for a combunation of columns

Hi all

 

I need a calculated column that will return me a distinct count where the combination of plant & line is equal to the [Segment] = "AA".

 

See below a sample:

 

o59393_0-1693204715689.png

 

 

In this case L1 should return a Yes because it has only the segment AA.

 

Here is my dax:

 

 

Stills Dedicated Line = 
VAR x =
CALCULATE(
    DISTINCTCOUNT('SKU by line - Official'[Segment]),
    FILTER(
        'SKU by line - Official',
        'SKU by line - Official'[Manufacturing plant of production] = EARLIER('SKU by line - Official'[Manufacturing plant of production]) &&
        'SKU by line - Official'[Manufacturing line] = EARLIER('SKU by line - Official'[Manufacturing line]) &&
        'SKU by line - Official'[Segment] = "AA"
    )
)
RETURN
IF(x = 1, "Yes", "No")

 

 

How can i get it right?

 

Thanks.

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

Is this what you are looking for?

Screenshot_3.png

View solution in original post

2 REPLIES 2
Ahmedx
Super User
Super User

Is this what you are looking for?

Screenshot_3.png

Thanks @Ahmedx 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.

Top Solution Authors