cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

Caso SQL en la función DAX 'SWITCH' no admite la comparación de valores de tipo

Tengo caso de convento SQL en DAX

está mostrando que el error puede alguien guiar qué error hice

La función 'SWITCH' no admite la comparación de valores de tipo True/False con valores de tipo Text. Considere la posibilidad de utilizar la función VALUE o FORMAT para convertir uno de los valores.

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"
			)

)

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Caso SQL en la función DAX 'SWITCH' no admite la comparación de valores de tipo

@M_OVAISJANZEB no está seguro acerca de esta parte de la instrucción switch

    _Equipment_term_type,"Equipment",
     
    _Accessories_term_type,"Accessories",
    





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.





View solution in original post

1 REPLY 1
Highlighted
Super User IV
Super User IV

Re: Caso SQL en la función DAX 'SWITCH' no admite la comparación de valores de tipo

@M_OVAISJANZEB no está seguro acerca de esta parte de la instrucción switch

    _Equipment_term_type,"Equipment",
     
    _Accessories_term_type,"Accessories",
    





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.





View solution in original post

Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors