Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

DAX Countif equivalent without explicit compare

I've seen a number of "DAX Countif" Q&A, but they all seem to have an explicit comparison, which I don't want.  Here's my scenario:   Customer   Option     OptionChoice ABC        Flavor     Banan...
  • parry2k's avatar
    8 years ago

    Try following 3 measures (I break it down for easy reading)

     

    Number of Options = COUNT(Options[Option])
    
    Total Options = CALCULATE(COUNT(Options[Option]), ALLSELECTED(Options[OptionChoice]))
    
    
    % Choice = DIVIDE([Number of Options], [Total Options],0)