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
pawelj795
Post Prodigy
Post Prodigy

Recuento de elementos que se produce de nuevo

Hola
Necesito crear 2 medidas.

  • El primero debe contar cuántos elementos se producen de nuevo hoy.
  • El segundo debe decir cuántas veces se produce este elemento en particular en el pasado.

Datos de muestra a continuación:

FechaID de artículo
02.10.2020 (hoy)

A

02.10.2020B
02.10.2020C
01.10.2020B
28.09.2020C
27.09.2020C
1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hola @pawelj795 ,

Por favor, intente esto:

Measure 1 = 
var t1_= 
    CALCULATETABLE (
        VALUES ( 'Table'[Item ID] ),
        FILTER (
            ALL ( 'Table'[Date] ),
            'Table'[Date] < MAX('Table'[Date]) )
        )
var t2_= 
    CALCULATETABLE (
        VALUES ( 'Table'[Item ID] ),
        FILTER (
            ALL ( 'Table'[Date] ),
            'Table'[Date] = MAX('Table'[Date]) )
        )
return
COUNTROWS(INTERSECT(t1_,t2_))
Measure 2 = CALCULATE(COUNT('Table'[Date]),ALLEXCEPT('Table','Table'[Item ID]))
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

6 REPLIES 6
v-xuding-msft
Community Support
Community Support

Hola @pawelj795 ,

Por favor, intente esto:

Measure 1 = 
var t1_= 
    CALCULATETABLE (
        VALUES ( 'Table'[Item ID] ),
        FILTER (
            ALL ( 'Table'[Date] ),
            'Table'[Date] < MAX('Table'[Date]) )
        )
var t2_= 
    CALCULATETABLE (
        VALUES ( 'Table'[Item ID] ),
        FILTER (
            ALL ( 'Table'[Date] ),
            'Table'[Date] = MAX('Table'[Date]) )
        )
return
COUNTROWS(INTERSECT(t1_,t2_))
Measure 2 = CALCULATE(COUNT('Table'[Date]),ALLEXCEPT('Table','Table'[Item ID]))
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.
amitchandak
Super User
Super User

@pawelj795 ,

La información que ha proporcionado no me está aclarando el problema. Por favor, puede explicar con un ejemplo.

Estas pueden ser dos medidas que puedo obtener de un alto nivel

calculate(distinctcount(Table[Item ID]), Table[Date] á today())

calculate(distinctcount(Table[Item ID]), Table[Date] < today())


Apreciamos tus Felicitaciones.

Hola @amitchandak

En alusión a mi muestra anterior, explico lo que quise decir.

  • Primera medida:
    El resultado debe ser 2, porque sólo el elemento "B" y el elemento "C" aparecen de nuevo hoy.
  • Segunda medida:
    Para el punto "B" el resultado debe ser 2. (también incluye hoy) - Apareció en 02.10.2020 y 01.10.2020
    Para el punto "C" el resultado debe ser 3. - Apareció en 02.10.2020, 28.09.2020 y 27.09.2020.

    Si aún no está claro para ti, por favor dime qué parte es confusa.

.

.

.

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.