Forum Discussion
filter problem in a calculate function - power bi desktop
- 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.
OK, It is very hard to help you when I dont have to much information about your data, BUT, using the values you showed us I found a way to help you with your problem, I can send you the Power BI file if you want just give me your email. Let me know if this helps.
Best
Miguel Myers
Mykhael Thanks a lot for all these screenshots !! I will try to do the same :)
The measure suggested by Greg_Deckler worked too :smileywink:
Thanks for your time !! :smileyhappy:
Jessica