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

Card display Percentage of Total

Hello,

 

I have something really simple, yet can't solve for it easily.

I have a collumn, with two choice values "1" and "0".

 

The card displays the count of the "1", which for this example is 200.

Now I would like the card to show the percentage the "1" value is of the total, so there are 200 "1" and 800 "0", for it to display 20%. 

1 ACCEPTED SOLUTION

Accepted Solutions
RobbeVL Established Member
Established Member

Re: Card display Percentage of Total

Hi there,

 

This is just a basic measure.

Calculate(count(COLUMN); COLUMN = "1")

/

count(Column)

 

--> then just change type to %

View solution in original post

10 REPLIES 10
MCornish Member
Member

Re: Card display Percentage of Total

In the measure your using, use CALCULATE in conjunction with ALL or ALLSELECTED, depending on your needs

 

DIVIDE( CALCULATE( COUNTROWS( [Table Containing Data] ), [Column] = 1) ,

             CALCULATE( [Your Measure], ALL( [Your Table] ) ),

             0) 

RobbeVL Established Member
Established Member

Re: Card display Percentage of Total

Hi there,

 

This is just a basic measure.

Calculate(count(COLUMN); COLUMN = "1")

/

count(Column)

 

--> then just change type to %

View solution in original post

Penhoat Frequent Visitor
Frequent Visitor

Re: Card display Percentage of Total

Hey,

 

thanks, but something seems to go wrong:

 

PercentageCalculation =
Calculate(count(table[column1]); [column1]="1")
/
count([column1])
 
Doesn't work. Mentions "syntax for ';' is incorrect". 
MCornish Member
Member

Re: Card display Percentage of Total

The ; is suppose to be a ,

RobbeVL Established Member
Established Member

Re: Card display Percentage of Total

Hi,

 

Thats becouse I live somewhere else Smiley Wink

Replace ";" by ","


If you would use more filters in the report or visual, use the solution below!!

Good Luck!

Penhoat Frequent Visitor
Frequent Visitor

Re: Card display Percentage of Total

Thanks, thought of that, but something still seems to go wrong Smiley Sad :

 

PercentageCalculation =
Calculate(count(table[column1]), [column1]="1")
/
count([column1])
 
Value for 'column1' cannot be determined.  Either 'column1' doesn't exist, or there is no current row for a column named 'column1'. Which is fair, as it's the collumn name, not row name Smiley Sad
RobbeVL Established Member
Established Member

Re: Card display Percentage of Total

Ofcourse.. Smiley Happy 
You will have to adjust the tablename I used to the tablename you use.
If you plan on using PowerBI more, I can really sggest following link:

https://docs.microsoft.com/en-us/power-bi/guided-learning/

Penhoat Frequent Visitor
Frequent Visitor

Re: Card display Percentage of Total

Haha no I did that, I'm just changing the name and collumn names when posting here. 

Highlighted
MCornish Member
Member

Re: Card display Percentage of Total

Use COUNTROWS rather than COUNT

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 475 members 5,141 guests
Please welcome our newest community members: