Forum Discussion
Selectedvalues() on calculated column
Hi SebastianLM,
As a general solution, you can use USERELATIONSHIP() if we don't want to build relationship between tables. If possible, could you share some sample data and expected result you want to achieve?
Regards,
Jimmy Tao
- SebastianLM8 years agoHelper I
Thanks Anonymous and v-yuta-msft,
Quick question first, this USERELATIONSHIP() function apply he filters done in both sides? Because I don't want that, I just want to make a calculated column in one table using the unique selected item of a slicer of a not related table.
I'm trying this without success:
I created one measure called SELECTEDM in table ANTIGRIPGSK:
SELECTEDM = SELECTEDVALUE('4SLICER'[VISUAL])
I created a calculated column called VIZ in table ANTIGRIPGSK:
VIZ = SWITCH([SELECTEDM],"CATEGORY",ANTIGRIPGSK[CATEGORIA],"FABRICANTE PHARMA",ANTIGRIPGSK[FABRICANTE],"MARCA PHARMA",ANTIGRIPGSK[MARCA],"ETAPA DE VIDA PHARMA ESPECIAL",ANTIGRIPGSK[ETAPA DE VIDA],"VARIEDAD PHARMA",ANTIGRIPGSK[VARIEDAD],"PRESENTACION PHARMA",ANTIGRIPGSK[PRESENTACION],"NA")
In the screnshoots below you can see the current behaviour that I don't understand, it is always retrieving the else value of the SWITCH() function, also VIZ is not generating any error, and SELECTEDM is retreiving the value I expect when I select something in '4SLICER'[VISUAL]