Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric certified for FREE! Don't miss your chance! Learn more
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 @Qotsa
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 @Qotsa
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 @Qotsa
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 69 | |
| 59 | |
| 47 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 107 | |
| 104 | |
| 39 | |
| 27 | |
| 27 |