Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

If function to ignore row context

Hey all!   I am trying to create a measure using the IF function. The measure is supposed to calculate a sales provision based on a departments performance on hitrate, but on employee level.   S...
  • MattAllington's avatar
    7 years ago

    Yes it is possible, but DAX formulas always depend on the table and relationship structure. You haven’t provided any info about your setup, so it is not possible to give you an accurate answer.

     

    In short, this has nothing to do with row context, it is filter context. When you put department into a table, the department filters the underlying data and gives you the result. When you add employee, a new filter context is added to employee preventing the department level calc working. It is a simple fix - just remove the filter from employee. Something like this. 

    CALCULATE([measure],ALL(table[employee]))

  • Ashish_Mathur's avatar
    7 years ago

    Hi,

    Since you will have various combinations of departments, hit rates and provisions, it will be much better to table this data in a 3 column Table and then build relationships.  We can then write measures to get your desired result.