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
Jon07
Helper I
Helper I

Se ha corregido el total ignorando una segmentación

Hola

He visto esta pregunta muchas veces, pero no tengo la solución para trabajar.

Tengo dos medidas: YTD_endringer y YTD_benchmark

La primera medida debe calcular el total acumulado, basado en la segmentación de datos. El segundo debe ser fijo, calculando el total ignorando la segmentación.

Mi medida se ve así, usando la función all() para ignorar a no prevail.

YTD_benchmark = CALCULATE(
    SUM(endringer[ANTALL]), 
    FILTER(
        ALLSELECTED(endringer),
        endringer[WeekNumber] <= MAX(endringer[WeekNumber])
        && endringer[DATO].[Year]= MAX(endringer[DATO].[Year])
    ), all(endringer[KUNDE])
)

p1.PNGp2.PNG

Cualquier ayuda es muy apreciada, gracias!

7 REPLIES 7
Greg_Deckler
Super User
Super User

quizás:

YTD_benchmark - CALCULATE(
SUM(changes[COUNT]),
FILTRO (
ALL(cambios),
changes[WeekNumber] <-MAX(changes[WeekNumber])
&& Cambios[FECHA]. [Año]- MAX(cambios[FECHA].[ Año])
)
)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Funcionó como un encanto, pero ¿podría explicar por qué? No era demasiado intuitivo basado en otras soluciones que he visto.

Probablemente una orden de operaciones con los FILT que tenía. El ALLSELECTED estaba filtrando basado en KUNDE y luego su ALL entró en acción, pero en ese momento los datos ya fueron filtrados por KUNDE.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Lo siento @Greg_Deckler, estaba celebrando pre-maturaly.

Al poner all(endringer) ignora todas las segmentaciones, mientras que me gustaría que sólo ignorar a un solo específico.
¿Hay alguna manera de volver a los demás, pero seguir ignorando sólo a uno?

Para la finalización, funciona con allexcept(table, col1, col2, etc), excepto el que quiero ignorar. Es un poco torpe, si tuviera un poco de rebanadoras. Por suerte, no lo hago.

Sí, otra forma de hacerlo probablemente sería usar la función REMOVEFILTERS que desearía hacer si tuviera toneladas de segmentaciones.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Ya veo, gracias por la ayuda!

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.