Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Combining Multiple DAX Measures - how to do it?

Hi - I have a couple of measures that I compare against each other to get another measure - I'd like to be able to put all 3 of them into one longer DAX measure, is that possible?? Is there a more el...
  • Greg_Deckler's avatar
    5 years ago

    Anonymous Try:

    WEEK 31 AVAILABILITY =
    
    VAR __WEEK31TotalProducts =
    CALCULATE(
    COUNTROWS ('Combined_GPI'),
    FILTER('Combined_GPI','Combined_GPI'[Week] = 31)
    )
    
    VAR __WEEK31OutofStock =
    CALCULATE(
    COUNTROWS ('Combined_GPI'),
    FILTER('Combined_GPI','Combined_GPI'[OOS] = 1),
    FILTER('Combined_GPI','Combined_GPI'[Week] = 31)
    )
    
    RETURN
      1 - DIVIDE(('Combined_GPI'[__WEEK31OutofStock]), ('Combined_GPI'[__WEEK31TotalProducts]))