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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Doliveira
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
Anonymous
Not applicable

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] ) )

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

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] ) )

Thanks @Anonymous! 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]))
Greg_Deckler
Super User
Super User

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))

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

as a newbie I am faced to same issue. I have tried to create a measure to use in the Card but does not show the proper % . only shows 100% (if I delete the denominator part the right cont of sales is shown, if I add the denominator then only 100% shown)
I have in the page 2 slicers (brand and quarter) and below chart summarizing the Count of sales (not the sum as per my data I need to count the number of sales)
then I need to show the 2 cards on the right (Lyon % of total count & Paris % of total count)
QuarterBrandRegionSales (NBR CARS)    
1Nissanlyon14 lyon Paris
1NissanParis30 32% 68%
one of the measures used is here below
Nbr Dsp ref % = divide (CALCULATE ( COUNT ([Sales] ), Filter ('Table', [Region] = "Lyon")), CALCULATE(COUNT([Sales]),ALL('Table')))
 
appreciate your support
 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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