Forum Discussion

jessicaf31's avatar
jessicaf31
Advocate I
10 years ago
Solved

filter problem in a calculate function - power bi desktop

Hello !    I don't understand why my measure in Power Bi for Desktop doesn't work : it is a calculate function with a filter function (as I saw here: https://msdn.microsoft.com/fr-fr/library/dn7271...
  • Greg_Deckler's avatar
    Greg_Deckler
    10 years ago

    jessicaf31 - I believe your problem is context with your jourdernierjour and/or DernierJour measure. In the context of your report, it shows 3, but in the row context when your sumjoursemaine measure is calculating, DernierJour always equals the MAX of that row and thus jourdernierjour always equals the joursemaine column.

     

    Try changing your DernierJour measure to this:

     

    DernierJour = MAXX(ALL(Transactions),Transactions[Date])

    What this does is force DernierJour to always evaluate in the context of all of the rows, which means that DerierJour will always be the MAX date within the table, which means that jourdernierjour will always be the value of the weekday of the MAX date in the table, which *should* mean that you get the right answer in your report.