cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Doliveira Frequent Visitor
Frequent Visitor

Showing card value as a percent of total

Hi!

 

I've created 2 cards with different values from the same column according by the date. Follow images for a better undestanding:

 

card 1.png              card 2.png

card 3.png                card 4.png 

Assuming that are 19 entries for 05/08/2017, 16 entries as "Atendidas" and 3 entries "Abandonadas", how can I change the card value to percentual of the total (84% Atendidas / 16% Abandonadas) ? 

 

Tks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
adamflath Member
Member

Re: Showing card value as a percent of total

There are multiple ways to do this, here is one: Create a new measure

 

% of Abandonadas =
VAR Total_of_Abandonadas =
    CALCULATE (
        COUNTA ( Table1[Disposicao do Contato] ),
        Table1[Disposicao do Contato] = "Abandonadas"
    )
RETURN
    DIVIDE ( Total_of_Abandonadas, COUNTA ( Table1[Disposicao do Contato] ) )
 
 
Remember, the VAR function just allows you to put all the needed calculations into one measure.  You can just make multiple measures and build them up.  Example:
 
Build a new measure to get the count of Abandonadas
Total Abandonadas =
    CALCULATE (
        COUNTA ( Table1[Disposicao do Contato] ),
        Table1[Disposicao do Contato] = "Abandonadas"
    )
 
Then build your % measure: 
  % of Abandonadas = DIVIDE ( Total Abandonadas, COUNTA ( Table1[Disposicao do Contato] ) )
3 REPLIES 3
Super User
Super User

Re: Showing card value as a percent of total

You should be able to click the drop down on your field and expand "Show value as" and then "Percent of grand total".

 

If not, then you would need to create a couple measures like:

 

Attendees = CALCULATE(COUNT([Contado]),FILTER(Table,[Contado]="Attendee")) / CALCULATE(COUNT([Contado]),ALL(Table))

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


Highlighted
adamflath Member
Member

Re: Showing card value as a percent of total

There are multiple ways to do this, here is one: Create a new measure

 

% of Abandonadas =
VAR Total_of_Abandonadas =
    CALCULATE (
        COUNTA ( Table1[Disposicao do Contato] ),
        Table1[Disposicao do Contato] = "Abandonadas"
    )
RETURN
    DIVIDE ( Total_of_Abandonadas, COUNTA ( Table1[Disposicao do Contato] ) )
 
 
Remember, the VAR function just allows you to put all the needed calculations into one measure.  You can just make multiple measures and build them up.  Example:
 
Build a new measure to get the count of Abandonadas
Total Abandonadas =
    CALCULATE (
        COUNTA ( Table1[Disposicao do Contato] ),
        Table1[Disposicao do Contato] = "Abandonadas"
    )
 
Then build your % measure: 
  % of Abandonadas = DIVIDE ( Total Abandonadas, COUNTA ( Table1[Disposicao do Contato] ) )
Doliveira Frequent Visitor
Frequent Visitor

Re: Showing card value as a percent of total

Thanks @adamflath! Using the VAR function solve the problem! But when I change the day that there're no entry of "abandonadas", the card shows (Blank).

 

How can I upgrade this code to add "ISBLANK" function?

 

% of Atendidas = VAR Total_of_Atendidas = CALCULATE (COUNTA ('Relatório Detalhado de Chamadas'[Disposição do Contato]);'Relatório Detalhado de Chamadas'[Disposição do Contato] = "Atendidas")

RETURN

    DIVIDE (Total_of_Atendidas; COUNTA ('Relatório Detalhado de Chamadas'[Disposição do Contato]))