pbiforum123
6 years agoPost Patron
Help required in Switch statement
Since the first statement for "Total Sales" consists of the dates rest of the statement is not executed. If I remove the first statement which is
"Total Sales" rest of the statement is executed. What change I should be doing to make sure that I get all the statement. Please help
Date_Group =
SWITCH (
TRUE (),
Sales[Date] >= date(1900,1,1)
&& Sales[Date] <= date(2900,12,31), "Total Sales",
Sales[Date] >= date(1900,1,1)
&& Sales[Date] <= date(2019,9,30), "SalesOlderThanThisMonth",
Sales[Date] >= date(2019,9,30)
&& Sales[Date] <= date(2019,10,31), "SalesThisMonth",
Sales[Date] >= date(2019,10,31)
&& Sales[Date] <= date(2019,11,30), "SalesNextMonth",
Sales[Date] >= date(2019,11,30)
&& Sales[Date] <= date(2900,12,31), "SalesFuture"
)