cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Victor1986
Helper I
Helper I

achar o percentual entre total de FAIXA TEMPO por periodo dividido pelo valor total de cada período

Como calcular o valor da coluna (FAIXA TEMPO) distribuído em colunas abaixo com valor de cada periodo (ACIMA DE 24H, AC DE 4H ETC...) dividido pelo valor total de cada período?

O Objetivo é achar o percentual entre as FAIXA TEMPO dividido  pelo valor total de cada período

exemplo: Jun/21 --> Em branco (45/12684) Acima de 12h (2513/12684) Acima de 24h (2434/12684) Acima de 4h (2583/12684) 

21/jul--> Em branco (30/13206) Acima de 12h (2545/13206) Acima de 24h (3037/13206) Acima de 4h (2707/13206) 

Victor1986_0-1659708776372.png

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Luca_Yu
Regular Visitor

Hi @Victor1986 ,

Below is my test table:

Luca_Yu_1-1660034860279.png

Create five measure and add it to table visual:

Total =
SUMX (
    'Table 1',
    [Em branco] + [DE 12h] + [DE 24h] + [DE 4h] + [DE 7Dias] + [ATE 4h]
)
Em/Total =
VAR cur_em =
    SELECTEDVALUE ( 'Table 1'[Em branco] )
VAR a =
    DIVIDE ( cur_em, 'Table'[Total] )
RETURN
    a
DE 12h/Total =
VAR cur_12 =
    SELECTEDVALUE ( 'Table 1'[DE 12h] )
VAR a =
    DIVIDE ( cur_12, 'Table'[Total] )
RETURN
    a
DE24/Total =
VAR cur_24 =
    SELECTEDVALUE ( 'Table 1'[DE 24h] )
VAR a =
    DIVIDE ( cur_24, 'Table'[Total] )
RETURN
    a
DE 4h/Total =
VAR cur_4 =
    SELECTEDVALUE ( 'Table 1'[DE 4h] )
VAR a =
    DIVIDE ( cur_4, 'Table'[Total] )
RETURN
    a

Luca_Yu_0-1660034833014.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
Luca_Yu
Regular Visitor

Hi @Victor1986 ,

Below is my test table:

Luca_Yu_1-1660034860279.png

Create five measure and add it to table visual:

Total =
SUMX (
    'Table 1',
    [Em branco] + [DE 12h] + [DE 24h] + [DE 4h] + [DE 7Dias] + [ATE 4h]
)
Em/Total =
VAR cur_em =
    SELECTEDVALUE ( 'Table 1'[Em branco] )
VAR a =
    DIVIDE ( cur_em, 'Table'[Total] )
RETURN
    a
DE 12h/Total =
VAR cur_12 =
    SELECTEDVALUE ( 'Table 1'[DE 12h] )
VAR a =
    DIVIDE ( cur_12, 'Table'[Total] )
RETURN
    a
DE24/Total =
VAR cur_24 =
    SELECTEDVALUE ( 'Table 1'[DE 24h] )
VAR a =
    DIVIDE ( cur_24, 'Table'[Total] )
RETURN
    a
DE 4h/Total =
VAR cur_4 =
    SELECTEDVALUE ( 'Table 1'[DE 4h] )
VAR a =
    DIVIDE ( cur_4, 'Table'[Total] )
RETURN
    a

Luca_Yu_0-1660034833014.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@Luca_Yu como que voce montou a sua tabela de teste?

 

Victor1986_0-1660915388847.png

 

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. I cannot help you without usable sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. I cannot use screenshots of your source data.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors