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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
apenaranda
Post Patron
Post Patron

Modify operation of the matrix total

Hello,
I have the following matrix that is composed of the rows of two fields of a table and two measures for the values. The matrix comes out correctly minus the total, as you can see it makes the sum of all the sub-records and what would interest me is for it to do the same operation as the sub-values.
The measurements dias rotura and %rotura are as follows:

 

% Rotura = [Cant Rotura]/[Dias Envio laborable2]
dias rotura = IF(COUNT('newintranet roturas'[codigo])=BLANK(),0,COUNT('newintranet roturas'[codigo]))
Dias Envio laborable2 = CALCULATE(COUNTROWS(Fechas),ALL(Fechas),DATESBETWEEN(Fechas[Date],[Fecha inicio],[Fecha final]),Fechas[Día Semana número] in {1,2,3,4,5})

 

apenaranda_0-1716529233504.pngapenaranda_1-1716529246388.png

apenaranda_2-1716529266007.png

Do you know how I can make the total do the same operation as the rows? or failing that, if that could not be done, eliminate that total, which is simply the sum.
Thank you

1 ACCEPTED SOLUTION

Hola @Syndicate_Admin ,
Crear medidas

Total = SUM('Table'[Value])
Percentage = 
VAR a = SELECTEDVALUE('Table'[Value])
VAR b = 
CALCULATE(
    SUM('Table'[Value]),
    ALLEXCEPT(
        'Table',
        'Table'[Type]
    )
)
RETURN
a/b
Result = 
IF(
    ISFILTERED('Table'[Part]),
    [Percentage],
    1
)

Resultado final

vheqmsft_0-1716967247261.png

Saludos
Alberto He

Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente

View solution in original post

3 REPLIES 3
apenaranda
Post Patron
Post Patron

It worked well for me, now I no longer get the incorrect total, at least it comes out blank and everything else is correct.

apenaranda_0-1716789433645.png

 


Is there a way to calculate the total but without adding it?

Hola @Syndicate_Admin ,
Crear medidas

Total = SUM('Table'[Value])
Percentage = 
VAR a = SELECTEDVALUE('Table'[Value])
VAR b = 
CALCULATE(
    SUM('Table'[Value]),
    ALLEXCEPT(
        'Table',
        'Table'[Type]
    )
)
RETURN
a/b
Result = 
IF(
    ISFILTERED('Table'[Part]),
    [Percentage],
    1
)

Resultado final

vheqmsft_0-1716967247261.png

Saludos
Alberto He

Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente

Syndicate_Admin
Administrator
Administrator

Hola @Syndicate_Admin ,
Aquí algunos pasos que quiero compartir, puedes consultarlos si se ajustan a tu requerimiento.
Aquí están mis datos de prueba:

vheqmsft_0-1716774937517.png

Crear una medida

Total = 
IF(
    ISFILTERED('Table'[Part]),
    SUM('Table'[Value]),
    BLANK()
)

Resultado final

vheqmsft_1-1716774978882.png

Puede consultar esta documentación
Manejo inteligente de jerarquías en DAX - SQLBI

Saludos
Alberto He


Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Top Solution Authors