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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Community Champion
Community Champion

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


Follow on LinkedIn
@ 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!:
DAX For Humans

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.