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

Calcular total de faixas acima de 12h acima de 24h acimas de 4h acima de 7dias até 4h dividido

Como calcular total de faixas ... acima de 12h... acima de 24h... acimas de 4h... acima de 7dias... até 4h ...dividido pelo total de cada periodo para obter a porcentagem

 

Victor1986_0-1659621932441.png

 

3 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Victor1986 , You want to get month total of say measure M1

 

then

calculate([m1], filter(allselected(Date), Date[Period]  = max(Date[Period]) ) )

 

or

 

calculate([m1], filter(allselected(Date[Period]  ), Date[Period]  = max(Date[Period]) ) )



!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

View solution in original post

Bom dia  @amitchandak 

 

Necessito calcular a coluna (FAIXAS DE TEMPO) que contempla os valores abaixo na tabela, de acima de 12h, acima de 24h, acima de 4h etc... 21 etc.) dividido pelo TOTAL de cada periodo

Victor1986_0-1659705700078.png

 

consegue me ajudar?

View solution in original post

foucaultf
Frequent Visitor

Hi @Victor1986 ,

 

Please try following steps:

 

1.Is your data as shown picture 1 ? You may need to transform the data from the picture 1 to picture 2.

foucaultf_0-1660039517560.png   

picture 1

 

 foucaultf_1-1660039517562.png

picture 2

       

 

2.you need to create a measure called total.

 

total = SUMX('table2','table2'[column]+'table2'[ATE 4h]+'table2'[ACIMA DE 7Dias]+'table2'[ACIMA DE 4h]+'table2'[ACIMA DE 24h]+'table2'[ACIMA DE 12h]) 

 

 

3.Create the following measure to calculate the percentage for each column.

 

ACIMA DE 12h% = 
VAR ACIMADE12hsum = SUM('table2'[ACIMA DE 12h])
VAR total = [total]
VAR column_percentage = DIVIDE(ACIMADE12hsum,total)
RETURN
column_percentage

ACIMA DE 24h% = 
VAR ACIMADE24hsum = SUM('table2'[ACIMA DE 24h])
VAR total = [total]
VAR column_percentage = DIVIDE(ACIMADE24hsum,total)
RETURN
column_percentage

ACIMA DE 4h% = 
VAR ACIMADE4hsum = SUM('table2'[ACIMA DE 4h])
VAR total = [total]
VAR column_percentage = DIVIDE(ACIMADE4hsum,total)
RETURN
column_percentage

ACIMA DE 7Dias% = 
VAR ACIMADE7Diassum = SUM('table2'[ACIMA DE 7Dias])
VAR total = [total]
VAR column_percentage = DIVIDE(ACIMADE7Diassum,total)
RETURN
column_percentage

ATE 4h% = 
VAR ATE4hsum = SUM('table2'[ATE 4h])
VAR total = [total]
VAR column_percentage = DIVIDE(ATE4hsum,total)
RETURN
column_percentage

column% = 
VAR columnsum = SUM('table2'[column])
VAR total = [total]
VAR column_percentage = DIVIDE(columnsum,total)
RETURN
column_percentage

 

 

4.In report page, you can get result you want.

foucaultf_2-1660039517563.png

 

Best Regards,

View solution in original post

3 REPLIES 3
foucaultf
Frequent Visitor

Hi @Victor1986 ,

 

Please try following steps:

 

1.Is your data as shown picture 1 ? You may need to transform the data from the picture 1 to picture 2.

foucaultf_0-1660039517560.png   

picture 1

 

 foucaultf_1-1660039517562.png

picture 2

       

 

2.you need to create a measure called total.

 

total = SUMX('table2','table2'[column]+'table2'[ATE 4h]+'table2'[ACIMA DE 7Dias]+'table2'[ACIMA DE 4h]+'table2'[ACIMA DE 24h]+'table2'[ACIMA DE 12h]) 

 

 

3.Create the following measure to calculate the percentage for each column.

 

ACIMA DE 12h% = 
VAR ACIMADE12hsum = SUM('table2'[ACIMA DE 12h])
VAR total = [total]
VAR column_percentage = DIVIDE(ACIMADE12hsum,total)
RETURN
column_percentage

ACIMA DE 24h% = 
VAR ACIMADE24hsum = SUM('table2'[ACIMA DE 24h])
VAR total = [total]
VAR column_percentage = DIVIDE(ACIMADE24hsum,total)
RETURN
column_percentage

ACIMA DE 4h% = 
VAR ACIMADE4hsum = SUM('table2'[ACIMA DE 4h])
VAR total = [total]
VAR column_percentage = DIVIDE(ACIMADE4hsum,total)
RETURN
column_percentage

ACIMA DE 7Dias% = 
VAR ACIMADE7Diassum = SUM('table2'[ACIMA DE 7Dias])
VAR total = [total]
VAR column_percentage = DIVIDE(ACIMADE7Diassum,total)
RETURN
column_percentage

ATE 4h% = 
VAR ATE4hsum = SUM('table2'[ATE 4h])
VAR total = [total]
VAR column_percentage = DIVIDE(ATE4hsum,total)
RETURN
column_percentage

column% = 
VAR columnsum = SUM('table2'[column])
VAR total = [total]
VAR column_percentage = DIVIDE(columnsum,total)
RETURN
column_percentage

 

 

4.In report page, you can get result you want.

foucaultf_2-1660039517563.png

 

Best Regards,

amitchandak
Super User
Super User

@Victor1986 , You want to get month total of say measure M1

 

then

calculate([m1], filter(allselected(Date), Date[Period]  = max(Date[Period]) ) )

 

or

 

calculate([m1], filter(allselected(Date[Period]  ), Date[Period]  = max(Date[Period]) ) )



!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

Bom dia  @amitchandak 

 

Necessito calcular a coluna (FAIXAS DE TEMPO) que contempla os valores abaixo na tabela, de acima de 12h, acima de 24h, acima de 4h etc... 21 etc.) dividido pelo TOTAL de cada periodo

Victor1986_0-1659705700078.png

 

consegue me ajudar?

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
Top Kudoed Authors