Forum Discussion
Anonymous
5 years agoNot applicable
Data and filters
Hello, I'm new to power BI. I would like to take a question. How do I filter a date with calculate? Example. Add and filter 01/04/2021?
Does not work. Forgive my English.
Try:
Lojas ativas1 = CALCULATE ( SUM ( 'Base OMS v2'[Lojas Ativas] ), FILTER ( 'Base OMS v2', 'Base OMS v2'[Data] = DATE ( 2021, 04, 01 ) ) )
3 Replies
- PaulDBrown
Community Champion
Try:
Lojas ativas1 = CALCULATE ( SUM ( 'Base OMS v2'[Lojas Ativas] ), FILTER ( 'Base OMS v2', 'Base OMS v2'[Data] = DATE ( 2021, 04, 01 ) ) )- AnonymousNot applicable
Thank you very much. 👍
- ERD
Community Champion
Hi Anonymous ,
In terms of your example, usage of VALUE function is incorrect. VALUE converts a text string that represents a number to a number. If your column is of Date type then in this particular example DATE function will help.
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.