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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Countifs in powerbi?

Here is my formula I use in excel to count the number of unique vendors with criteria language pair and subject matter.

 

=COUNTIFS(DataDump1!$C$2:$C$139526,A2,DataDump1!$E$2:$E$139526,B2)

 

Here is the data I am pulling from

DataDump.PNG

 

I am trying to the count the amount of vendors with the criteria (language Pair & Subject Matter). 

 

Can someone help me write a formula in power bi that will count the unique amount of vendors with two criteria (language Pair & Subject Matter)?

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

This is what I was looking for:

 

=
CALCULATE (
COUNTROWS ( DataDump1 ),
FILTER (
DataDump1,
DataDump1[languagePair] = EARLIER ( DataDump1[LanguagePair] )
),
FILTER (
DataDump1,
DataDump1[Subject Matter] = EARLIER ( DataDump1[Subject Matter] )
)
)

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

This is what I was looking for:

 

=
CALCULATE (
COUNTROWS ( DataDump1 ),
FILTER (
DataDump1,
DataDump1[languagePair] = EARLIER ( DataDump1[LanguagePair] )
),
FILTER (
DataDump1,
DataDump1[Subject Matter] = EARLIER ( DataDump1[Subject Matter] )
)
)

Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Try this formula

 

Formula =
CALCULATE (
    COUNTROWS ( DataDump1 ),
    ALLEXCEPT ( DataDump1, DataDump1[language pair], DataDump1[subject matter] )
)
Anonymous
Not applicable

@Zubair_Muhammad

 

Thank you for your response, however this didn't return the correct result.

 

I am looking for something like this, if row 1 has the vendor name of A+ Global Solutions and the language pair is chinese (China) -> English (United States) and the subject matter is IP- Non-Patent. Then I am looking for a formula to look through all the data and return how many times that combination is present in the data. 

 

Can you provide a formula to calculate that? I am new to DAX and would really appreciate it!

Hi @Anonymous,

 

Did @Zubair_Muhammad's solution work? You need to use it in a visual?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

No, it didn't work for me. I was able to find a different solution. Thanks for looking into this for me! I really appreciate.

@Anonymous

 

Try adding subject matter in above formula

 

Formula =
CALCULATE (
    COUNTROWS ( DataDump1 ),
    ALLEXCEPT (
        DataDump1,
        DataDump1[language pair],
        DataDump1[vendor name],
        DataDump1[subject matter]
    )
)

@Anonymous

 

I was curious about this issue, tried @Zubair_Muhammad solution but didn't get it to work for me. My DAX knowledge is limited to testing and reading posts on this forum and I'm sure there may be a better solution but this would work: I created a calculated column that combines all 3 column values into 1:

 

Combined = Sheet1[Purchase Order Vendor] & Sheet1[Language Pair] & Sheet1[Subject Matter]

 

...then created a simple measure:

UniqueCount = DISTINCTCOUNT(Sheet1[Combined])

 

Again, I'm sure there may be a completely single DAX formula that can do this but this worked for me.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors