This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi,
Below Switch statement works for me but I need to include else then the result is a text value.
So
If 'powerbi114 cmQualifications'[qualificationId] = 3892 or 4036 or 4038 then
Expiry Date = "Does not Expire"
Anyway I can modify below Switch to include this?
Solved! Go to Solution.
Hi @Anonymous
Sorry, my bad, all your conditions result in number and your else is text.
You will need to convert all the values you return to text using CONVERT() or FORMAT( 1, "") or return number in ELSE condition
Hi @Anonymous
Else is the last argument like
Expiry Date =
SWITCH(
TRUE(),
'powerbi114 cmQualifications'[qualificationId] = 3892,DATEADD('powerbi114 cmQualifications'[awardDate].[Date],3,YEAR),
'powerbi114 cmQualifications'[qualificationId] = 4036,DATEADD('powerbi114 cmQualifications'[awardDate].[Date],2,YEAR),
'powerbi114 cmQualifications'[qualificationId] = 4038,DATEADD('powerbi114 cmQualifications'[awardDate].[Date],3,YEAR),
"ELSE SOMTHING")
Thanks for reply.
I should have said I tried that but getting this error - Expressions that yield variant data-type cannot be used to define calculated columns.
Hi @Anonymous
Sorry, my bad, all your conditions result in number and your else is text.
You will need to convert all the values you return to text using CONVERT() or FORMAT( 1, "") or return number in ELSE condition
Perfect. Thank you.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 37 | |
| 29 | |
| 29 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 39 | |
| 33 | |
| 24 | |
| 23 |