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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
RobbeVL
Impactful Individual
Impactful Individual

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
RobbeVL
Impactful Individual
Impactful Individual

Hi there,

 

This is just a basic measure.

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

/

count(Column)

 

--> then just change type to %

Anonymous
Not applicable

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". 
RobbeVL
Impactful Individual
Impactful Individual

Hi,

 

Thats becouse I live somewhere else 😉

Replace ";" by ","


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

Good Luck!

Anonymous
Not applicable

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 😞
RobbeVL
Impactful Individual
Impactful Individual

Ofcourse.. 🙂 
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/

Anonymous
Not applicable

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

Use COUNTROWS rather than COUNT

Anonymous
Not applicable

I had to remove the "" around 1 and it worked 🙂

really appreciate the help guys, I'm sure it's super straightforward for you haha.

The ; is suppose to be a ,

MCornish
Responsive Resident
Responsive Resident

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) 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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