Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have convent SQL case into DAX
it's showing that error can anyone guide what mistake I did
Function 'SWITCH' does not support comparing values of type True/False with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.
Type = Var _Feature = CONTAINSSTRING(EODWQ[Reporting Segment Quantity],"Feature")
Var _Accessories = CONTAINSSTRING(EODWQ[Reporting Segment Dollars],"Accessory")
Var _VoiceAddALines = CONTAINSSTRING(EODWQ[Product Category],"'Business L3 & More") //|| CONTAINSSTRING(EODWQ[Product Category],"Family L3 & More") || CONTAINSSTRING(EODWQ[Product Category],"No Credit Check L3 & More")
Var _PrepaidActivations = CONTAINSSTRING( EODWQ[Product Category], "'Prepaid Voice") //|| CONTAINSSTRING( EODWQ[Product Category], "'Prepaid Mobile Internet")
Var _Equipment = CONTAINSSTRING( EODWQ[Product Category], "'Inventory : Equipment" )
var _BTSActs = CONTAINSSTRINGEXACT( EODWQ[Product Category], "'Business") //|| CONTAINSSTRINGEXACT( EODWQ[Product Category], "'Individual / Family") || CONTAINSSTRINGEXACT( EODWQ[Product Category], "'No Credit Check")
Var _Voice_Activations = CONTAINSSTRINGEXACT( EODWQ[Product Category], "'Business L1/L2") //|| CONTAINSSTRINGEXACT( EODWQ[Product Category], "'Family L1/L2") || CONTAINSSTRINGEXACT( EODWQ[Product Category], "'Individual") || CONTAINSSTRINGEXACT( EODWQ[Product Category], "'No Credit Check L1/L2")
Var _Upgrade_term_type = CONTAINSSTRING(EODWQ[term type],"Upgrade")
Var _Null_term_type = CONTAINSSTRING(EODWQ[term type],"NULL")
Var _Equipment_term_type = CONTAINSSTRING(EODWQ[term type],"Equipment")
Var _Accessories_term_type = CONTAINSSTRING(EODWQ[term type],"Accessories")
Var _Feature_term_type = CONTAINSSTRING(EODWQ[term type],"Feature")
Var _Activation_term_type = CONTAINSSTRING(EODWQ[term type],"Activation")
Var _SprintMigration_term_type = CONTAINSSTRING(EODWQ[term type],"Sprint Migrations")
Var _PrepaidToPostpaid_term_type = CONTAINSSTRING(EODWQ[term type],"Prepaid to Postpaid")
Return
switch( true(),
_Upgrade_term_type,
switch( true(),
_Feature ,"Features",
_Accessories, "Accessories",
_VoiceAddALines, "Upgrades",
_PrepaidActivations, "Prepaid Activations",
_Equipment, "Equipment","Upgrades"
),
_Activation_term_type,
switch( true(),
_Feature ,"Features",
_Accessories, "Accessories",
_VoiceAddALines, "Voice Add A Lines",
_PrepaidActivations, "Prepaid Activations",
_BTSActs,"BTS Activations",
_Voice_Activations,"Voice Activations",
_Equipment, "Equipment","Voice Activations"
),
_Equipment_term_type,"Equipment",
switch( true(),
_Feature ,"Features",
_Accessories, "Accessories",
_VoiceAddALines, "Voice Add A Lines",
_PrepaidActivations, "Prepaid Activations",
_BTSActs,"BTS Activations",
_Voice_Activations,"Voice Activations",
_Equipment, "Equipment","Equipment"
),
_Accessories_term_type,"Accessories",
switch( true(),
_Feature ,"Features",
_Accessories, "Accessories",
_VoiceAddALines, "Voice Add A Lines",
_PrepaidActivations, "Prepaid Activations",
_BTSActs,"BTS Activations",
_Voice_Activations,"Voice Activations",
_Equipment, "Equipment","Accessories"
),
_Feature_term_type,"Features",
switch( true(),
_Feature ,"Features",
_Accessories, "Accessories",
_VoiceAddALines, "Voice Add A Lines",
_PrepaidActivations, "Prepaid Activations",
_BTSActs,"BTS Activations",
_Voice_Activations,"Voice Activations",
_Equipment, "Equipment","Features"
),
_Null_term_type,
switch( true(),
_Feature ,"Features",
_Accessories, "Accessories",
_VoiceAddALines, "Voice Add A Lines",
_PrepaidActivations, "Prepaid Activations",
_Voice_Activations,"Voice Activations",
"Equipment"
)
)
Solved! Go to Solution.
@Anonymous not sure about this part of the switch statement
_Equipment_term_type,"Equipment",
_Accessories_term_type,"Accessories",
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous not sure about this part of the switch statement
_Equipment_term_type,"Equipment",
_Accessories_term_type,"Accessories",
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 39 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 32 | |
| 27 | |
| 25 |