Forum Discussion
Anonymous
4 years agoNot applicable
IF statement with Dates in a measure
Hey there, I'd like to create a measure that will calculate something for me if it match some given criteria. For instance, in the following image I wanna create a measure that will count the num...
- 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
johnt75
Super User
4 years agoYou need to wrap Calendario[Data] inside a SELECTEDVALUE function.
Anonymous
4 years agoNot applicable
Thanks for helping me.
I didn't understand how I have to create the formula. Could please show me?
Thanks in advance, buddy.
- johnt754 years ago
Super User
var Excluded CALCULATE(COUNTROWS(Base), FILTER(Base, Base[assignee] <> "Someone")) return IF( SELECTEDVALUE(Calendario[Data]) > 16/03/2022, Excluded, CALCULATE(COUNTROWS(Base)))