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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
markus123
Frequent Visitor

Percent of a specific value between two columns

Dear all,

 

pretty sure this was asked before, but i haven't found the right topic.

 

I would like to calculate the percentage of a specific value in Column A in relation to the total number of rows in Column B.

In Detail:

 

- Column A = "Customers"

- Column B = "Contacted" (possible answer here "yes" or "no"

 

I need the percentage of "yes", in order to get the contact ratio.

 

Thanks for your help in advance!

6 REPLIES 6
PijushRoy
Super User
Super User

Hi @markus123 

Try this

PercentageCalculation = VAR _count = COUNTA(Data[Contacted])
VAR _countyes = CALCULATE(COUNTA(Data[Contacted]),Data[Contacted]="Yes")
RETURN
_countyes/_count
 
0pb1.JPG
 
If you have any question, please let me know.
If solve your requirement, please mark this answer as SOLUTION
If this comment helps you, please LIKE this comment/Kudos



Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Don't know why, but it is not working.

 

Maybe i need to explain it a little bit easier.

 

I just need the following formula in power bi language:

 

All rows from column A (Contacted) with the value "YES", devided by All rows from column B (Customers)

@markus123 
Try this
PercentageCalculation = 
VAR _count = COUNT('TableName'[Customer])
VAR _countyes = CALCULATE(COUNTA('TableName'[Contacted]),'TableName'[Contacted]="Yes")
RETURN
_countyes/_count

If you have any question, please let me know.
If solve your requirement, please mark this answer as SOLUTION
If this comment helps you, please LIKE this comment/Kudos




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





PijushRoy
Super User
Super User

@markus123 
Please share sample data and expected result to understand requriement clearly




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





markus123_0-1645374232927.png

 

Maybe this image will help. You can 4 rows in total, means 4 customers.

Column "Contacted" show two times "yes & two times "no".

Contact ratio should be 50%, but i don't how to create to measure correctly.

 

It is a list of 350 customers in total.

@markus123 
Try this
PercentageCalculation = 
VAR _count = COUNT('TableName'[Customer])
VAR _countyes = CALCULATE(COUNTA('TableName'[Contacted]),'TableName'[Contacted]="Yes")
RETURN
_countyes/_count

If you have any question, please let me know.
If solve your requirement, please mark this answer as SOLUTION
If this comment helps you, please LIKE this comment/Kudos



Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.