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
kumarm
Frequent Visitor

El gran total de Lastnonblank está equivocado

Estoy tratando de obtener lastnonenenenenen el valor en blanco en una medida . Devuelve el valor correcto en el nivel de fila. Pero en el nivel Grand total su valor incorrecto que devuelve. Parece que está tomando el gran total de julio en lugar de agregar para cada operación.

Pronóstico de Ingresos Totales DP YE - Prueba de Informe ?
VAR LASTNONBLANK_1 de VAR ( VAR LASTNONBLANK_1?
CALCULAR (
[Pronóstico de Ingresos Total DP - Informe],
LASTNONBLANK (
'Dim Period'[PeriodDate],
CALCULATE ([Total Income Forecast DP - Report] )
)
)
devolución
LASTNONBLANK_1

kumarm_0-1598350411049.png

Cuando forzo a calcular el total general usando sumx. También me devuelve un valor equivocado.

Pronóstico de Ingresos Totales DP YE - Prueba de Informe ?
VAR LASTNONBLANK_1 de VAR ( VAR LASTNONBLANK_1?
CALCULAR (
[Pronóstico de Ingresos Total DP - Informe],
LASTNONBLANK (
'Dim Period'[PeriodDate],
CALCULATE ([Total Income Forecast DP - Report] )
)
)
devolución
If(HASONEVALUE('Dim Implementer'[Operation]),LASTNONBLANK_1,sumx(VALUES('Dim Implementer'[Operation]),LASTNONBLANK_1))

Después de usar la fórmula anterior, el total general se convierte en 45,668,410

El valor total grandioso correcto debe ser :-13,784,559

Gracias de antemano.

1 ACCEPTED SOLUTION

Hola @kumarm ,

Puede crear esta medida:

Result = 
VAR lastnoblank =
    CALCULATE (
        [Total Income Forecast DP - Report],
        LASTNONBLANK ( 'Dim Period'[PeriodDate], [Total Income Forecast DP - Report] )
    )
VAR tab =
    SUMMARIZE (
        'Table',
        'Table'[Operation],
        "lastnoblank",
            CALCULATE (
                [Total Income Forecast DP - Report],
                LASTNONBLANK (
                    'Dim Period'[PeriodDate],
                    CALCULATE ( [Total Income Forecast DP - Report] )
                )
            )
    )
RETURN
    IF (
        HASONEVALUE ( 'Dim Period'[PeriodDate].[Month] ),
        lastnoblank,
        SUMX ( tab, [lastnoblank] )
    )

re.png

Adjunto un archivo de muestra en el siguiente, espera ayudarle.

Best Looks,
Yingjie Li

Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@kumarm Esto parece un problema de totales de medida. Muy común. Vea mi post al respecto aquí: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Además, esta Medida Rápida, Medir Totales, La Palabra Final debe obtener lo que necesita:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907


@ 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...
amitchandak
Super User
Super User

@kumarm, pruebe una medida como

sumx( values(Table[operations]),[Total Income Forecast DP YE - Report test ])

o mover el cálculo en esta medida

Gracias amitchandak por su respuesta rápida.


La solución que sugirió que funciona sólo cuando creo una medida separada utilizando la existente.

Pero si quiero ver datos basados en otra dimesión el valor parece estar equivocado.

Quiero ver el total general correcto cuando selecciono otra dimensión también.

Por favor, puede sugerir cómo manejar esto.

gtotal.JPG

Hola @kumarm ,

Puede crear esta medida:

Result = 
VAR lastnoblank =
    CALCULATE (
        [Total Income Forecast DP - Report],
        LASTNONBLANK ( 'Dim Period'[PeriodDate], [Total Income Forecast DP - Report] )
    )
VAR tab =
    SUMMARIZE (
        'Table',
        'Table'[Operation],
        "lastnoblank",
            CALCULATE (
                [Total Income Forecast DP - Report],
                LASTNONBLANK (
                    'Dim Period'[PeriodDate],
                    CALCULATE ( [Total Income Forecast DP - Report] )
                )
            )
    )
RETURN
    IF (
        HASONEVALUE ( 'Dim Period'[PeriodDate].[Month] ),
        lastnoblank,
        SUMX ( tab, [lastnoblank] )
    )

re.png

Adjunto un archivo de muestra en el siguiente, espera ayudarle.

Best Looks,
Yingjie Li

Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

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.