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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Double distinct count

Hello, everyone 🙂
My table follows this structure:

COD  CV  
11111.1
11115.2
11116.2
22211.2
22216.2
33311.1
33315.2
33315.2

 

I would like to create a measure that distinct counts all types of CVs that are neither 11.1 nor 11.2, for each distinct COD. 
So, in the example table above, the count should be:

COD 111 = 2 (CV 15.2 and CV 16.2)
COD 222 = 1 (CV 16.2)
COD 333 = 1 (CV 15.2)

So, the measure should bring me the value 4 (2 +1 + 1).

Can someone help me?

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@req7 Try this measure. I uploaded a PBIX file below.

Measure = 
    COUNTROWS(
        SUMMARIZE(
            FILTER(
                'Table (2)',
                [CV  ] <> 11.1 && [CV  ]<>11.2
            ),
            [COD  ],[CV  ]
        )
    )

Greg_Deckler_0-1599614257208.png



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

This measure works

=SUMX(SUMMARIZE(VALUES(Data[COD]),Data[COD],"ABCD",CALCULATE(DISTINCTCOUNT(Data[CV]),Data[CV]<>11.1,Data[CV]<>11.2)),[ABCD])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Community Champion
Community Champion

@req7 Try this measure. I uploaded a PBIX file below.

Measure = 
    COUNTROWS(
        SUMMARIZE(
            FILTER(
                'Table (2)',
                [CV  ] <> 11.1 && [CV  ]<>11.2
            ),
            [COD  ],[CV  ]
        )
    )

Greg_Deckler_0-1599614257208.png



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@Anonymous , Try like

sumx(Values(Table[COD ]),calculate( distinctCOUNT(Table[CV]) filter(Table, not(Table[CV] in {11.1 , 11.2}))))

sumx(Values(Table[COD ]),calculate( distinctCOUNT(Table[CV]) filter(Table, not(Table[CV] in {"11.1" , "11.2"}))))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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