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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
av9
Helper III
Helper III

Cómo mostrar clientes que han tenido 3 meses negativos consecutivos en valores

Estoy tratando de marcar qué clientes han tenido los últimos 3 meses consecutivos como valores negativos. Mis datos se parecen a la siguiente tabla:

Campos: Cliente, Fecha, Valor

ClienteFeb-20Mar-20Abr-20
Cliente A-$100.00-$200.00-$ 500.00
Cliente B$500.00$120.00-$ 800.00
Cliente C$1,150.00$500.00$ 900.00

La salida me mostraría el cliente A, ya que cumple los criterios.

ClienteFeb-20Mar-20Abr-20
Cliente A-$100.00-$200.00-$ 500.00
4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hola @av9 ,

Puede crear una medida como se indica a continuación:

Client with 3 consecutive negative months = 
CALCULATE (
    MAX ( 'Client'[Client] ),
    FILTER (
        'Client',
        'Client'[20-Feb] < 0
            && 'Client'[20-Mar] < 0
            && 'Client'[20-Apr] < 0
    )
)

negative values for last 3 months.JPG

Saludos

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Tengo fechas configuradas en una mesa de calender, así que no funciona de esta manera

amitchandak
Super User
Super User

@av9, intente

negativo consecutivo ?
Var _tab ?summarize(filter(Table,DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-3,MONTH)),Table[Client],Table[Month],"_1", sum(Table[Value])
devolución
countX(filter(summarize(_tab,[Client],"_1",if(sum(Table[Value])>0,1,0) ),[_1] >-3),[Client])

No puedo hacer que la medida funcione, debo explicar que el modelo de datos está configurado en 3 tablas separadas:

Tabla de cliente(dim), Tabla de fechas(dim), Tabla de valores(hecho)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors