Forum Discussion

ZeeMTee's avatar
ZeeMTee
New Member
3 years ago
Solved

Need help with DAX for count

Hello DAX master, I am currently stuck.  I have this table, with 3 columns PartNumber, Month and Changed.  I want to count Changed = Yes, for each PartNumber and display the results in a visual wh...
  • Ritaf1983's avatar
    Ritaf1983
    3 years ago

    Hi ZeeMTee 
    You can add a flag column, which you can use as a filter.
    It returns "yes" if the same part in the same month has more than 1 yes.
    Dax formula for this calculated column :

    CountYes = if ( CALCULATE(COUNTROWS('Table'),
    ALLEXCEPT('Table', 'Table'[Pnumber], 'Table'[Month]),
     'Table'[Changed] = "Yes")>1, "yes", "blank")

    As you have it you can use it to filter your matrix :

    Link to a sample file 

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly