Forum Discussion

YOSIEMPREYO12's avatar
YOSIEMPREYO12
Frequent Visitor
1 year ago
Solved

CANTIDAD DE LOCALES

Buenas tardes estimados

 

Tengo una tabla con 30 locales, articulo y total de venta

 

Yo necesito una fórmula que cuando selecciono un artículo me diga cuantos locales lo vendieron

Puedo hacerlo con un recuento distintivo pero necesito una fórmula porque ese dato luego lo voy a dividir por otros datos

 

Ejemplo: selecciono articulo mesa y que me diga cuantos locales vendieron esa mesa

Gracias

  • v-sdhruv's avatar
    v-sdhruv
    1 year ago

    Hi YOSIEMPREYO12 ,

    You can make use of SUMX function here which will count stores that sold the article, and then sums it properly across months.

    Assuming you have a date table and your model is correctly related.
    StoresSoldPerMonth =
    SUMX(
    VALUES('Date'[Month]),
    CALCULATE(
    DISTINCTCOUNT(Sales[Store]),
    Sales[TotalSale] > 0
    )
    )
    Hope this helps!
    If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
    Thank you.

6 Replies

  • Create another reference table that lists all articles. Keep that table disconnected from the data model. Then create a measure that calculates your desired result based on the selected value of that article list.

  • YOSIEMPREYO12's avatar
    YOSIEMPREYO12
    Frequent Visitor

    pero necesito que los filtros funcionen. Conseguí hacerlo con distinctcount el problema ahora es que si elijo solo un mes me trae el dato correcto. Pero si elijo 2 me lo trae mal.

    osea, Marzo 10 locales, Abril 4 locales, si los elijo a ambos me dice 11 porque busca los locales diferentes pero preciso el total por mes