Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Countif in DAX

Hi all,

 

I have a matrix visual created. some of the columns is as below:

 

Part NoBAU

111

A

222A
333A
444B

 

I would like to get a count of the number of part numbers which have BAU as 'A'.

 

BAU is a measure created.

 

Any help is appreciated!

 

Thank you!

Megha

  • Anonymous Try:

    Measure =
      VAR __Table = ADDCOLUMNS(DISTINCT('Table'[Part No]),"__BAU",[BAU])
    RETURN
      COUNTROWS(FILTER(__Table,[__BAU]="A"))

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous Try:

    Measure =
      VAR __Table = ADDCOLUMNS(DISTINCT('Table'[Part No]),"__BAU",[BAU])
    RETURN
      COUNTROWS(FILTER(__Table,[__BAU]="A"))