I am trying to execute the below query but I keep getting the error: Cannot convert value '2017Q2' of type Text to type True/False.
In this query I want to figure out a full year based on the four quarters (ie."2017Q1","2017Q2","2017Q3","2017Q4").
To explain what the code should do
If the [Closed Quarter] = 2017Q1"or"2017Q2"or"2017Q3"or"2017Q4" then display ,"2017 FULL YEAR"
else
If the [Closed Quarter] = 2018Q1"or"2018Q2"or"2018Q3"or"2018Q4" then display , "2018 FULL YEAR"
else
If the [Closed Quarter] = 2019Q1"or"2019Q2"or"2019Q3"or"2019Q4" then display ,"2019 FULL YEAR"
else
If the [Closed Quarter] = 2020Q1"or"2020Q2"or"2020Q3"or"2020Q4" then display ,"2020 FULL YEAR"
else
If the [Closed Quarter] = 2021Q1"or"2021Q2"or"2021Q3"or"2021Q4" then display ,"2021 FULL YEAR"
else display "UNKNOWN"
How do I correct the error of converting type Text to type True/False?
Please see below Power Bi code
Full Year = SWITCH(
TRUE(),
OR('Case Data'[Closed Quarter] = "2017Q1"||"2017Q2","2017Q3"||"2017Q4"),"2017 FULL YEAR",
OR('Case Data'[Closed Quarter] = "2018Q1"||"2018Q2","2018Q3"||"2018Q4"), "2018 FULL YEAR",
OR('Case Data'[Closed Quarter] = "2019Q1"||"2019Q2","2019Q3"||"2019Q4"), "2019 FULL YEAR", OR('Case Data'[Closed Quarter] = "2020Q1"||"2020Q2","2020Q3"||"2020Q4"), "2020 FULL YEAR", OR('Case Data'[Closed Quarter] = "2021Q1"||"2021Q2","2021Q3"||"2021Q4"), "2021 FULL YEAR", "UNKNOWN")