Forum Discussion
Countifs in powerbi?
- Anonymous8 years ago
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] )
)
)
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!
Anonymous
Try adding subject matter in above formula
Formula =
CALCULATE (
COUNTROWS ( DataDump1 ),
ALLEXCEPT (
DataDump1,
DataDump1[language pair],
DataDump1[vendor name],
DataDump1[subject matter]
)
)- dtartaglia8 years ago
Resolver I
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.