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
PowerB1Rookie
New Member

How would I calculate column values for each row?

Hi, 

 

I have a table with multiple comparison columns like below:


Person   Rent    Paid    Void 

1            Yes      No      No 

2            No      No      No

3            Yes      Yes      Yes

 

the table I have is a lot bigger and has about 20 columns with various yes/no fields in each. 

How would I calculate how many yes/no's there are for each person/row?

 

1 ACCEPTED SOLUTION
Shreeram04
Resolver III
Resolver III

Hi @PowerB1Rookie 

 

Please find the below screenshot for your reference.

 

Measure:

yes = var paid= CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[Paid]="Yes"))
var rent=CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[Rent]="Yes"))
var void= CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[Void]="Yes"))
return
paid+rent+void
 
No = var paid= CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[Paid]="No"))
var rent=CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[Rent]="No"))
var void= CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[Void]="No"))
return
paid+rent+void
 
Screenshot:
Shreeram04_0-1665071629590.png

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

thanks,

View solution in original post

1 REPLY 1
Shreeram04
Resolver III
Resolver III

Hi @PowerB1Rookie 

 

Please find the below screenshot for your reference.

 

Measure:

yes = var paid= CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[Paid]="Yes"))
var rent=CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[Rent]="Yes"))
var void= CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[Void]="Yes"))
return
paid+rent+void
 
No = var paid= CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[Paid]="No"))
var rent=CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[Rent]="No"))
var void= CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[Void]="No"))
return
paid+rent+void
 
Screenshot:
Shreeram04_0-1665071629590.png

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

thanks,

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.