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
giorgiokatr
Helper V
Helper V

Contar clientes que están en todos los meses

Tengo una cortadora del mes de columna y cuando selecciono los tres meses (1,2,3) me gustaría mostrarme los clientes que están presentes en los 3 meses

en este ejemplo sería 1 (cliente g)

¿es posible?

MesGrupoCliente
1ag
2bg
3cg
1aa
2bb
1ab
1 ACCEPTED SOLUTION

Hola @giorgiokatr ,

Puede modificar la medida de la siguiente manera:

In group = 
VAR _max =
    CALCULATE ( DISTINCTCOUNT ( 'Table'[month] ), ALLSELECTED ( 'Table' ) )
RETURN
    COUNTX (
        FILTER (
            SUMMARIZE (
                'Table',
                'Table'[customer],
                'Table'[group],
                "_count", DISTINCTCOUNT ( 'Table'[month] )
            ),
            [_count] = _max
                && [group] = SELECTEDVALUE ( 'Table'[group] )
        ),
        [customer]
    )

Cree otra medida para calcular no en este grupo:

Not in this group = 
VAR _count =
    CALCULATE ( DISTINCTCOUNT ( 'Table'[customer] ), ALL ( 'Table' ) )
RETURN
    _count - [In group]

group.png

Adjunto un archivo de muestra en el siguiente, espera ayudarle.

Best Looks,
Yingjie Li

Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

View solution in original post

8 REPLIES 8
amitchandak
Super User
Super User

@giorgiokatr , Pruebe este

medida :
var _max -calculate(distinctcount(Table[month]), allselcted(Table))
devolución
countx(filter(summarize(Table,table[customer],"_1",distinctcount(Table[month])),[_1] -_max),[cliente])

it works @amitchandak  great! can i add a second filter the group?

for example to find customers that are in 1,2,3 month and   (not or ) in group b?

Hola @giorgiokatr ,

Puede modificar la medida de la siguiente manera:

In group = 
VAR _max =
    CALCULATE ( DISTINCTCOUNT ( 'Table'[month] ), ALLSELECTED ( 'Table' ) )
RETURN
    COUNTX (
        FILTER (
            SUMMARIZE (
                'Table',
                'Table'[customer],
                'Table'[group],
                "_count", DISTINCTCOUNT ( 'Table'[month] )
            ),
            [_count] = _max
                && [group] = SELECTEDVALUE ( 'Table'[group] )
        ),
        [customer]
    )

Cree otra medida para calcular no en este grupo:

Not in this group = 
VAR _count =
    CALCULATE ( DISTINCTCOUNT ( 'Table'[customer] ), ALL ( 'Table' ) )
RETURN
    _count - [In group]

group.png

Adjunto un archivo de muestra en el siguiente, espera ayudarle.

Best Looks,
Yingjie Li

Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Hola @giorgiokatr

¿Puede probar lo siguiente:

Show_Common_Values = 
VAR MONTH1 =
    CALCULATETABLE ( VALUES ( 'Table'[customer] ), ALL('Table'),'Table'[month] = 1,'Table'[group]="b" )
VAR MONTH2 =
    CALCULATETABLE ( VALUES ( 'Table'[customer] ), ALL('Table'),'Table'[month] = 2 ,'Table'[group]="b" )
VAR MONTH3 =
    CALCULATETABLE ( VALUES ( 'Table'[customer] ), ALL('Table'),'Table'[month] = 3 ,'Table'[group]="b" )
RETURN
    CALCULATE (
        MAX ( 'Table'[customer] ),
        INTERSECT ( INTERSECT ( MONTH1, MONTH2 ), MONTH3 )
    )
themistoklis
Community Champion
Community Champion

@giorgiokatr

Cree una nueva medida y agregue la siguiente fórmula:

Dups =
VAR MONTH1 =
    CALCULATETABLE ( VALUES ( 'Table'[customer] ), 'Table'[month] = 1 )
VAR MONTH2 =
    CALCULATETABLE ( VALUES ( 'Table'[customer] ), 'Table'[month] = 2 )
VAR MONTH3 =
    CALCULATETABLE ( VALUES ( 'Table'[customer] ), 'Table'[month] = 3 )
RETURN
    CALCULATE (
        MAX ( 'Table'[customer] ),
        INTERSECT ( INTERSECT ( MONTH1, MONTH2 ), MONTH3 )
    )

gracias @themistoklis !

¡Gracias!

¿es posible trabajar cuando agredo la segmentación de datos para la columna de grupo también?

@giorgiokatr

Pruebe lo siguiente

Show_Common_Values = 
VAR MONTH1 =
    CALCULATETABLE ( VALUES ( 'Table'[customer] ), ALL('Table'),'Table'[month] = 1 )
VAR MONTH2 =
    CALCULATETABLE ( VALUES ( 'Table'[customer] ), ALL('Table'),'Table'[month] = 2 )
VAR MONTH3 =
    CALCULATETABLE ( VALUES ( 'Table'[customer] ), ALL('Table'),'Table'[month] = 3 )
RETURN
    CALCULATE (
        MAX ( 'Table'[customer] ),
        INTERSECT ( INTERSECT ( MONTH1, MONTH2 ), MONTH3 )
    )

muchas gracias, pero mi único problema es que la segmentación contiene muchos monhts y la segmentación de grupo contiene 120 valores.

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.