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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
mmp
Helper I
Helper I

Medida de filtrado basada en otra medida

Hola

Estoy tratando de obtener una lista de clientes que no ha estado en la tienda durante el mes anterior (basado en la selección de la fecha) y ha comprado al menos durante el período día-40 y día-59. Aquí está el script:

Max Achat Date = 
CALCULATE(
    MAX(BITKT[TKT_DATACHAT]),
    ALLEXCEPT(BITKT,BITKT[TKT_NUMCARTE])
)



Duration = 
VAR tday = IF(HASONEVALUE(BIDAT[DAT_date]),FIRSTDATE(BIDAT[DAT_date]))
RETURN  
IF (
    [Max Achat Date] > tday,
    0,
    DATEDIFF ( [Max Achat Date], tday, DAY )
)


Win Back 1 = VAR day_40 = DATEADD(BIDAT[DAT_date],-40,DAY)
VAR day_59 = DATEADD(BIDAT[DAT_date],-59,DAY) 
VAR quantite = CALCULATE(SUM(BITKT[TKT_QTE]),DATESBETWEEN(BIDAT[DAT_date],day_59,day_40))
RETURN

IF([Duration]>30 && quantite>1, 1,0)

Lo que estoy tratando de hacer ahora es contar el número de personas que están preocupadas por el Win Back 1.

Capture d’écran 2020-10-16 à 10.13.08.png

Lo intenté con SUMX, COUNTAX pero sin resultados.

¿Podrías ayudarme en eso?

Atentamente

Mohammad PATEL

2 REPLIES 2
amitchandak
Super User
Super User

@mmp , Trate de medir como

sumx(values(Table[N Cate]),[Win Back 1])

O

sumx(Summarize(Table,Table[N Cate], "_1",[Win Back 1]),[_1])

Hola @amitchandak,

Probé sus soluciones, pero no hay resultados, devuelve 0.

Mohammad PATEL

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors