Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
wongzqn
Frequent Visitor

Cortadora con grupo superpuesto

Hola, tengo una columna de códigos de proyecto que me gustaría tener una segmentación con la opción de: 'A', 'B', 'C', '123T', '123Y', donde 'A', 'B', 'C' agrupación se basa en la letra inicial del código del proyecto y '123T' y '123Y' basado en la cadena coincidente dentro del código del proyecto. La agrupación de códigos de proyecto no es mutuamente excluyente.

Quiero lograr algo como esto en mi tablero.

Screenshot 2020-09-29 172837.png

ProjectCode

A100Y
A123T
A123P
B009X
B123T
B123M
C777N
C123M
C997Y

Al seleccionar 'A' se devuelve:

A100Y
A123T
A123P

Al seleccionar '123T' se devuelve:

A123T
B123T

Gracias.

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hola @wongzqn ,

Por favor, intente esto:

Cree una nueva tabla desconectada como segmentación de datos:

Slicer = 
UNION (
    DISTINCT ( SELECTCOLUMNS ( 'Table', "ABC", LEFT ( 'Table'[ProjectCode], 1 ) ) ),
    SELECTCOLUMNS (
        'Table',
        "xxx", RIGHT ( 'Table'[ProjectCode], LEN ( 'Table'[ProjectCode] ) - 1 )
    )
)

Cree una medida:

Measure =
VAR selected =
    SELECTEDVALUE ( Slicer[ABC] )
VAR contain =
    SEARCH ( selected, MAX ( 'Table'[ProjectCode] ),, 999 )
RETURN
    IF ( ISFILTERED ( Slicer[ABC] ), contain )

2.gif

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-xuding-msft
Community Support
Community Support

Hola @wongzqn ,

Por favor, intente esto:

Cree una nueva tabla desconectada como segmentación de datos:

Slicer = 
UNION (
    DISTINCT ( SELECTCOLUMNS ( 'Table', "ABC", LEFT ( 'Table'[ProjectCode], 1 ) ) ),
    SELECTCOLUMNS (
        'Table',
        "xxx", RIGHT ( 'Table'[ProjectCode], LEN ( 'Table'[ProjectCode] ) - 1 )
    )
)

Cree una medida:

Measure =
VAR selected =
    SELECTEDVALUE ( Slicer[ABC] )
VAR contain =
    SEARCH ( selected, MAX ( 'Table'[ProjectCode] ),, 999 )
RETURN
    IF ( ISFILTERED ( Slicer[ABC] ), contain )

2.gif

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @v-xuding-msft , this works for me!  🙂 

Hi @v-xuding-msft , 

 

Do you know why some visuals like Card/Pie chart are not responding to this slicer? 

Hola @wongzqn ,

La fórmula devuelve más de un valor de texto. Puede usar la tarjeta de varias filas en lugar de la tarjeta para mostrar los resultados. Y para el gráfico circular, puede mostrar valores numéricos,como valores resumidos, recuento o valores medios. Por lo tanto, debe cambiar la fórmula en función de sus requisitos.

3.gif

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Xue Ding @v-xuding-msft,

 

I actually have a data table like this:

 

DateDonor NameProject CodeDonation Amount
6-Jan-2019ABCA100Y100
8-Feb-2019XYZA123P200
5-Aug-2019POEC777N100
6-Dec-2019IOPA123P400
4-Jan-2020LOPB009X100
5-Mar-2020POEB123T500
6-Apr-2020MOOA997Y300

 

When I summarize the the YTD Donation into a single card visual, it is not responsive to the slicer. 

And also a pie chart on corporate donor count by project code, it is not responsive either. 

 

So I'm not sure what went wrong or needs to be fixed.

Fowmy
Super User
Super User

@wongzqn

Para obtener los resultados, debe crear una tabla adicional que divida los códigos en dos y combinarlos, lo que hice en Power Query y, a continuación, crear una medida que identifique el valor de segmentación de datos seleccionado con el código relevante. Por último, puede asignarlo a la segmentación de datos visual de la tabla y se filtra a medida que selecciona.

Puede descargar el archivo: HERE



Fowmy_0-1601376243494.png

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

amitchandak
Super User
Super User

@wongzqn , Probar como

Un valor a la vez

calculate(count(table[ProjectCode]), filter(all(Table), search(selectevalue(Table[ProjectCode]) ,Table[ProjectCode],1,0)>0))

mejor tener ProjectCode en una tabla independiente

calculate(count(table[ProjectCode]), filter(Table, search(selectevalue(Code[ProjectCode]) ,Table[ProjectCode],1,0)>0))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.