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 August 31st. Request your voucher.

Reply
George1973
Helper V
Helper V

Inventory Internal Transfers Issue with in/out WH in one operations table

Hi All,
I have a operations data table with the following layout:

Operation_IDOper_DateOper_Type_IDOper_Type_NameClient_Venfor_IDStock_toStock_From
12305-01-202147Sales 0001 
12412-01-202147Sales 0001 
12514-01-202147Sales 0002 
12615-01-202113Transfer 00020001
12720-01-202113Transfer 00030002
12821-01-202147Sales 0003 
12915-01-202147Sales 0003 
13020-01-202147Sales 0001 
13121-01-202147Sales 0001 
13215-01-202140Import 0001 
13320-01-202140Import 0001 
13421-01-202113Transfer 00020001
13515-01-202140Import 0001 
13620-01-202113Transfer 00010003
13721-01-202113Transfer 00010003

 

The "Operations Details" data table relates to that table by "Operations_ID". but it's not the issue here.

When it comes to calculate stock level per Stock(WH), mainly I have to refer "Stock_to" column, but when there is "Transfer" (Internal Goods Movement) I have to consider the "Stock_From" column too.. And that's my problem. I do have only one relationship with the Stock(WH) data table and can not do two relationship in the same time. Please help to solve this issue.

3 ACCEPTED SOLUTIONS
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @George1973 - you can have two relationship between the fact table and the Stock(HW) table.  The second relationship will be inactive.  You formula will need to activate the relationship when the "Transfer" is used.   Could you please upload a sample pbix file to help config the data model and measures?

View solution in original post

v-robertq-msft
Community Support
Community Support

Hi, 

According to your requirement, you want to use another column as the related column when the Operation Type is “Transfer”. I suggest you to use the calculated column like this to give them the relationship based on the [Stock_From] manually:

 

stock level per Stock=

IF([Stock_From]=”Transfer”,

Calculate(MAX(Operations_ID [stock level])),Filter(ALL(Operations_ID),[Stock_to]=Earlier(Operations Details[Stock_to])&& [Stock_From]=Earlier(Operations Details[Stock_ From])),

Operations_ID [stock level])

 

 

You can transform the DAX formula based on your table names and column names within the dataset and check if it can work.

 

Thanks in advance!

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

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

View solution in original post

Hi,

I did as you suggessted and used formula "Userelashioship" and it works!


George1973_0-1645079951744.png

It's a inactive relationship and here is the formula:

Total Transfer Out Related = 
CALCULATE(Measures_Inventory[Total Transfer Out],
USERELATIONSHIP(C_SKLAD[Stock_IN ID],TS_OPERATIONS[Stock_out ID]))

 

 

View solution in original post

3 REPLIES 3
v-robertq-msft
Community Support
Community Support

Hi, 

According to your requirement, you want to use another column as the related column when the Operation Type is “Transfer”. I suggest you to use the calculated column like this to give them the relationship based on the [Stock_From] manually:

 

stock level per Stock=

IF([Stock_From]=”Transfer”,

Calculate(MAX(Operations_ID [stock level])),Filter(ALL(Operations_ID),[Stock_to]=Earlier(Operations Details[Stock_to])&& [Stock_From]=Earlier(Operations Details[Stock_ From])),

Operations_ID [stock level])

 

 

You can transform the DAX formula based on your table names and column names within the dataset and check if it can work.

 

Thanks in advance!

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

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

Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @George1973 - you can have two relationship between the fact table and the Stock(HW) table.  The second relationship will be inactive.  You formula will need to activate the relationship when the "Transfer" is used.   Could you please upload a sample pbix file to help config the data model and measures?

Hi,

I did as you suggessted and used formula "Userelashioship" and it works!


George1973_0-1645079951744.png

It's a inactive relationship and here is the formula:

Total Transfer Out Related = 
CALCULATE(Measures_Inventory[Total Transfer Out],
USERELATIONSHIP(C_SKLAD[Stock_IN ID],TS_OPERATIONS[Stock_out ID]))

 

 

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.