Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How to create countifs in DAX - replicate Excel countifs

I'm trying to replicate Excel's countifs function. I've seen a couple other posts but I'm new to DAX and not totally clear how to do this.   How do I create a DAX formula that evaluates three separ...
  • mhossain's avatar
    6 years ago

    Hi Anonymous 

     

    use below dax, it should work

     

    Countifs=
    var delivery = 'Table'[Delivery]
    var salesdoc = 'Table'[SalesDoc]
    var item = 'Table'[Item]

    RETURN

    COUNTROWS(
    FILTER(
    all('Table'),
    delivery='Table'[Delivery] &&
    salesdoc=''Table'[SalesDoc] &&
    item='Table'[Item]))

     

     

     

    Please change the table name as per your table name, please let me know if this works for you.