Forum Discussion
IF statement with Dates in a measure
- 4 years ago
Hi, Anonymous
Usually we use date() function when we use date.
measure = IF ( SELECTEDVALUE ( Calendario[Data] ) > DATE ( 2022, 3, 16 ), Excluded, CALCULATE ( COUNTROWS ( Base ) ) )If your problem has been solved, you can mark the answer as solution to close the thread. If my post helps, please consider Accept it as the solution to help the other members find it more quickly. If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
Anonymous , You can use a date slicer and filter date table from column or connected column. You can use before slicer
hard coded date will be like
var Excluded CALCULATE(COUNTROWS(Base), FILTER(Base, Base[assignee] <> "Someone"))
return IF(Calendario[Data] > Date(2022,03,16) , Excluded, CALCULATE(COUNTROWS(Base)))
Thanks for the reply.
The problem is that when I type IF(Calendario[Data] >, the Bi underline the function showing that it has an
error in the formula. What did you meant with the first part of your reply? You can use a date slicer and filter date table from column or connected column. You can use before slicer. I didn't get that.