Forum Discussion
samnaw
2 years agoResolver I
If statement in DAX
Hi I am trying to do a if statement. IF CURRENT(YYYY-MM) = CurrentYearMonth THEN M1 And I want to put that date in a card. How can I do this.
- 2 years ago
I did it by creating a column, but I wish i didnt have to create one.
Created a new column:
CurrentYearMonthFlag =Switch( true(),[CurrentYearMonth]=FORMAT(today(), "YYYY-MM"),"Yes", "No")DAX statement:M0Date = CALCULATE(SUM(insertDatePLCS[M0]),FILTER('insertDatePLCS','insertDatePLCS'[CurrentYearMonthFlag]="Yes"))
samnaw
2 years agoResolver I
I did it by creating a column, but I wish i didnt have to create one.
Created a new column:
CurrentYearMonthFlag =
Switch( true(),
[CurrentYearMonth]=FORMAT(today(), "YYYY-MM"),"Yes", "No")
DAX statement:
M0Date = CALCULATE
(SUM(insertDatePLCS[M0]),
FILTER('insertDatePLCS','insertDatePLCS'[CurrentYearMonthFlag]="Yes"))