0

I have a table which has 2 columns , Branch and role. Basically I want 3rd column which will say 1) if a branch has all the three role (President,Treasurer,Secretary) then 1. 2) If a branch has 2 roles (President,Treasure/secretary) then 2 3) if a branch has 1 role (President/treasurer/secretary) then 3.

How m i going to achieve this. Below is my table structure.

enter image description here

1 Answer 1

1

You can do this by counting the rows of the branch, add a new column:

    YouGet = 
var br = Branch[Branch]
return 4 - CALCULATE(COUNTROWS(Branch);FILTER(Branch;br = Branch[Branch] && (Branch[Role] = "President" || Branch[Role] = "Secretary" || Branch[Role] = "Treasurer")))

4 - the row count is to get the result in line with what you ask for.

You can also choose to create a second table with the3 items and a relation between the tables. This gives the advantage that you can extend.

Sign up to request clarification or add additional context in comments.

1 Comment

The problem is there are many other roles, but i want to count only those which has President,Secretary and Treasurer roles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.