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.
I believe that you are missing a "MAX" in your FILTER. I did this measure:
Last Value = CALCULATE(SUM([Value]),FILTER(ALL(dates),[date]=MAX([Date])))
My table had a Date column and Value column, this returned the value from the last date in the table.
I am not sure how day 3 (Wednesday) is the last date in your table but I assume that's just how your data model works.
Dear Greg,
right now I'm struggling with a FILTER formula in my calculation - COUNTROWS /FILTER combination to be precise, but it doesn't work for me..
I see that your solutions are always workable and I take a dare to ask:
could you advise maybe, what do I do wrong? 🙂
thank you in advance for your help!
Katia