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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
biswad
Advocate I
Advocate I

Power Bi calculated column to do the lookup

I have a table called "Branch" and another table called "Role" as per the screenshot and I want to have the output as mentioned in my output screenshot. I want to add a calculated column in the Branch table as "Status" where it will check the branch and the role against it in the "Role" table and check if the role " Doctor, Nurse, Plumber) are available under that branch in branch table or not. Basically, I would like to get an output in an additional column in-branch table where it will check each role and if it finds a branch in the role table that has all the three roles it will update the status in the branch table against that branch as a status "Full", if any one of the roles found then"1/3 Partial" if any 2 roles found than update "2/3 Partial" if non of the role found or if any branch which is not in the role table it will update the status against that branch and the missing branch as "Dorment". How can I achieve this, any help on this would be greatly appreciated.

 

Branch Table
Branch
Cambridgeshire
Norfolk
Suffolk
Peterborough
Central Bedfordshire
Milton Keynes
 

 

Role Table
BranchRole
CambridgeshireDoctor
CambridgeshireNurse
NorfolkDoctor
NorfolkNurse
NorfolkPlumber
SuffolkPlumber
PeterboroughDriver

 

 

Output
BranchStatus
Cambridgeshire2/3 Partial
Cambridgeshire2/3 Partial
NorfolkFull
SuffolkDorment
PeterboroughDorment
Central BedfordshireDorment
Milton KeynesDorment
1 REPLY 1
lbendlin
Super User
Super User

Link both tables via the Branch field

Filter the Role table to exclude all other roles

Create a table visual with the branch field from the branch table

enable "Show items with no data"

create a measure that converts the distinct count of roles into words

 

Measure = SWITCH(DISTINCTCOUNT(Role),3,"Full",2,"2/3 Partial",1,"1/3 Partial","Dormant")

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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