Forum Discussion
Syndicate_Admin
Administrator
4 years agoFunción MID como variable
Total shipped qty =
SUMX('Amazon YTD','Amazon YTD'[Shipped Quantity]*RELATED('summary table'[MPU])) Hola a todos Tengo una tabla que tiene el nombre del producto, que incluye el tamaño del pa...
Syndicate_Admin
Administrator
4 years agoTotal shipped qty =
VAR _Title= SELECTCOLUMNS('Amazon YTD',"Title",'Amazon YTD'[Title]) --chooses to colum of [Title] to apply the MID function to; this is from the same table so did not have to use the Related function
VAR _SearchPack = SEARCH("of",_Title,,0)+3 --In order to find the starting position for the MID function
VAR _MPU = value(MID(_Title,_SearchPack,1)) --extracts the pack size and converts to numeric value
return
SUMX('Amazon YTD','Amazon YTD'[Shipped Quantity]*_MPU) --iterates over [shipped qty] and multiplies by the pack size to arrive at the volume@amitchandak - Amit, reescribí el código y no usé la función RELATED ya que estoy sacando la columna String ([Title]) de la misma tabla.
Pero este está devolviendo un error de la siguiente manera:
¿Alguna razón y cómo salir de ella?
Gracias