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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Calculated Column help

I have a table called 'All Pos' which has a many to one relationship with another table called 'Pay BF List'

 

The All Pos table I has a key column called [Position #] and another column called [Vacancy]

 

The Pay BF List table also has a key column called [Position #] and another called [Pay BF]  

 

Vacancy column contains the either a status of 'Encumbered' or 'Vacant'

Pay BF column contains the either a status of 'Transfer In' or 'Transfer Out'

 

I am trying to create a calculated column in the All Pos table that will verify if there is an entry in the 'Pay BF List' that has the same [Position #] if so it would return one of 4 results:

 

Encumbered + Transfer In = Encumbered

Vacant + Transfer In = Encumbered

Encumbered + Transfer Out = Vacant

Vacant + Transfer Out = Vacant

 

I hope this makes sense, I am reading a DAX book but I am only 80 pages in 700 to go!

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

Assume you already create a relationship between these two tables on Pos columns, you can try below codes to create the columns.

Column = IF(RELATED(TBLPayBF[PAY BF])="Transfer In","Encumbered",IF(RELATED(TBLPayBF[PAY BF])="Transfer Out","Vacant"))

Or

Column 2 = SWITCH(RELATED(TBLPayBF[PAY BF]),"Transfer In","Encumbered","Transfer Out","Vacant")

020105.jpg

Kindly let me know if this helps.
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

Assume you already create a relationship between these two tables on Pos columns, you can try below codes to create the columns.

Column = IF(RELATED(TBLPayBF[PAY BF])="Transfer In","Encumbered",IF(RELATED(TBLPayBF[PAY BF])="Transfer Out","Vacant"))

Or

Column 2 = SWITCH(RELATED(TBLPayBF[PAY BF]),"Transfer In","Encumbered","Transfer Out","Vacant")

020105.jpg

Kindly let me know if this helps.
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

parry2k
Super User
Super User

@Anonymous it will be much easier if throw the data in an excel file and also the expected output, It will much quicker to put the solution together. Share the file using one drive/google drive.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

https://drive.google.com/file/d/1wNCaxHWdJupJLiEifnkwxT_kQuSnnJJu/view?usp=sharing 

 

Tks for the reply parry2k.

 

I would like to create a new column that would update column B's information on Vacancy status.

 

If a position # in A is found in D, then return one of the following:

 

If B = Encumbered and E = Transfer In, then return value "Encumbered" in new created column.

If B = Vacant and E = Transfer In, then return value "Encumbered" in new created column.

If B = Encumbered and E = Transfer Out, then return value "Vacant" in new created column.

If B = Vacant and E = Transfer Out, then return value "Vacant" in new created column.

 

Hope this helps, I look forward to your reply.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors