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

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

Reply
Sachintha
Helper III
Helper III

Count of occurrences based on multiple columns

I have a dataset that looks like this. Only the columns relavant to this question are listed here.

ID,Person1,Sign1,Person2,Sign2,Person3,Sign3
1,A,TRUE,X,TRUE,M,FALSE
2,B,TRUE,Y,TRUE,,FALSE
3,C,TRUE,,FALSE,,FALSE
4,D,TRUE,X,TRUE,N,TRUE
5,A,FALSE,Y,FALSE,,FALSE
6,B,TRUE,,FALSE,,FALSE
7,D,TRUE,,FALSE,,FALSE
8,D,TRUE,X,TRUE,,FALSE
9,A,TRUE,Z,TRUE,M,TRUE
10,A,TRUE,Y,FALSE,N,TRUE
11,C,FALSE,Z,FALSE,,FALSE
12,D,FALSE,,FALSE,,FALSE
13,B,TRUE,X,FALSE,N,TRUE
14,A,TRUE,X,TRUE,,FALSE
15,C,TRUE,Y,TRUE,,FALSE

Think of this as an 'approval' sheet. There are 3 persons, and spaces for each of them to sign their name. The Person1 column will always have a name, but the other two columns may or may not have names. Each of the 3 'Sign' columns are set to FALSE by default, and when they sign an item it'll be set to TRUE. So, the Person1 sign will go into Sign1, the Person2 sign will go into Sign2, etc.

 

An item is considered approved if all persons attached to it have signed their respective names. In other words, if a Person value is not blank, then the respective signature needs to be true.

 

So, once imported, I create the following 'Unapproved' column in DAX to identify the unapproved items:

Unapproved = 
    (Approvals[Person1] <> "" && Approvals[Sign1] = FALSE()) ||
    (Approvals[Person2] <> "" && Approvals[Sign2] = FALSE()) ||
    (Approvals[Person3] <> "" && Approvals[Sign3] = FALSE())

This gives me a final table that looks like this, filtered to show only the 'Unapproved = TRUE' items:

Screenshot 2024-03-14 134925.png

 

Now, my task is to createa  table/chart in PBI to show the names of persons listed in Person1, 2, and 3 columns, and show each person's unapproved item tally. Important to note that I want to show each individual who has an approval pending, not the number of unapproved items they're involved with. For instance, in the above example, I want to count only ID=5 against Person A's name, because although that person is involved in two other items that are unapproved (1 and 10), in both of those cases Person A has approved their own name.

 

So, the table I'm looking for should look something like this:

Screenshot 2024-03-14 135613.png

 

How do I go about doing this?

 

 

 

1 ACCEPTED SOLUTION
JamesFR06
Resolver IV
Resolver IV

Hi

 

I have created a new table fom your original table. Your original table name is Person here.

 

Person sorted =
Var tab1=SUMMARIZE(Person,Person[ID],Person[Person1],Person[Sign1])
    Var tab2=SUMMARIZE(Person,Person[ID],Person[Person2],Person[Sign2])
    var tab3=SUMMARIZE(Person,Person[ID],Person[Person3],Person[Sign3])
    var _step1= union(tab1,tab2)
    var _step2=union(_step1,tab3)
    var result=filter(_step2,Person[Person1]<>"")
    RETURN
    result
 
after i have created a measure 
Nbr of false = calculate(count('Person sorted'[ID]),'Person sorted'[Sign1]=false)
 
and at the end I made a matrice with the new table and the measure
JamesFR06_0-1710453429749.png

 

View solution in original post

1 REPLY 1
JamesFR06
Resolver IV
Resolver IV

Hi

 

I have created a new table fom your original table. Your original table name is Person here.

 

Person sorted =
Var tab1=SUMMARIZE(Person,Person[ID],Person[Person1],Person[Sign1])
    Var tab2=SUMMARIZE(Person,Person[ID],Person[Person2],Person[Sign2])
    var tab3=SUMMARIZE(Person,Person[ID],Person[Person3],Person[Sign3])
    var _step1= union(tab1,tab2)
    var _step2=union(_step1,tab3)
    var result=filter(_step2,Person[Person1]<>"")
    RETURN
    result
 
after i have created a measure 
Nbr of false = calculate(count('Person sorted'[ID]),'Person sorted'[Sign1]=false)
 
and at the end I made a matrice with the new table and the measure
JamesFR06_0-1710453429749.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.