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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Niprina
New Member

Somar percentagens entre linhas

Olá comunidade PBI,

 

Estou com um grande dilema e após muita investigação aqui e não só, não consigo orquestrar uma solução.

 

Referente a esta situação abaixo, o que eu queria era que a soma das percentagens das linhas (tambem pode ser dos valores, que facilmente chego a percentagem), ou seja, a linha 1 ficava com 2,80%, a linha 2 com 5,60%, a linha 3 com 8,08% ... e por ai fora.

 

Alguem pode dar uma ajuda? Não consigo aplicar uma medida para isto.

 

Muito obrigado.

 

PBI.jpg

 

Em excel é extramente fácil!

 

PBI_n.jpg

 

 

1 ACCEPTED SOLUTION

This work for me. Thanks

 

Acumulativo =
VAR LastVisibleIndice =
    MAX ( Sprt_ABC[Índice] )
VAR SomaIndice =
    FILTER (
        ALLSELECTED (
            Sprt_ABC[Emissor da ordem],
            Sprt_ABC[Índice]
        ),
        Sprt_ABC[Índice] <= LastVisibleIndice
    )
VAR Result =
    CALCULATE (
        [Soma Vol AA],
        SomaIndice
    )
RETURN
    Result

View solution in original post

6 REPLIES 6
Niprina
New Member

It gave me the same values 😞

 

PBI_2.jpg

@Niprina 

% =

SUMX (

ALL ( 'Table'[Index] ),

DIVIDE ( [Soma de Vol AA], [Total Vol AA] )
)

This work for me. Thanks

 

Acumulativo =
VAR LastVisibleIndice =
    MAX ( Sprt_ABC[Índice] )
VAR SomaIndice =
    FILTER (
        ALLSELECTED (
            Sprt_ABC[Emissor da ordem],
            Sprt_ABC[Índice]
        ),
        Sprt_ABC[Índice] <= LastVisibleIndice
    )
VAR Result =
    CALCULATE (
        [Soma Vol AA],
        SomaIndice
    )
RETURN
    Result

It gave me all lines 100,00%, not this also... You are close 🙂

@tamerj1 you have give this solution to one user, but i cannot create the var currentindex, do you now why? I can only put measures not tablet data.

 

PBI.jpg

tamerj1
Super User
Super User

Hi @Niprina 

please try

% =

SUMX (

VALUES ( 'Table'[Index] ),

DIVIDE ( [Soma de Vol AA], [Total Vol AA] )
)

Helpful resources

Announcements
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!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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