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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.