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
perezco
Advocate III
Advocate III

"power bi" inactive relation for two fact tables same column (order_id)

under table1 ('Fact - order') I tried create the below column

Column order = CALCULATETABLE( LASTNONBLANK('Fact - order'[order_wid],'Fact - order'[order_wid]),USERELATIONSHIP('Fact - order'[order_wid],'Fact - order Parts'[order_wid]))


two fact order tables (relationship is inactive but 1 --->> *, I need   1 <<---*    because my intention is that any part is been choosen in table two will brings the orders from table 1 and their commodity, is this possible?

table one                                                             table two
order_ID - commodities   1<<---need be----*   order_id -parts# - partsQties
(unique values)                                                    (many)


----extra 

the commodity brings somehing like this 
Hard Drive-XXW34 :(2)

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Cperota ,thanks for the quick reply.

Hi @perezco ,

Regarding your question, I made an attempt.

The Table data is shown below:

vzhouwenmsft_0-1713322242395.png

vzhouwenmsft_1-1713322258103.png

vzhouwenmsft_2-1713322293951.png

Please follow these steps:

1.Modify the filter passing direction

vzhouwenmsft_3-1713322362670.png

2.Use the following DAX expression to create a measure

Measure = CALCULATE(SELECTEDVALUE('Fact - order'[Product]),USERELATIONSHIP('Fact - order Parts'[order_wid],'Fact - order'[order_wid]))

3.Final output

vzhouwenmsft_4-1713322468145.png

vzhouwenmsft_5-1713322482511.png

vzhouwenmsft_9-1713322573465.png

vzhouwenmsft_10-1713322591161.png

vzhouwenmsft_11-1713322601322.png

vzhouwenmsft_12-1713322625012.png

 

Best Regards,
Wenbin Zhou
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

3 REPLIES 3
Anonymous
Not applicable

Hi @Cperota ,thanks for the quick reply.

Hi @perezco ,

Regarding your question, I made an attempt.

The Table data is shown below:

vzhouwenmsft_0-1713322242395.png

vzhouwenmsft_1-1713322258103.png

vzhouwenmsft_2-1713322293951.png

Please follow these steps:

1.Modify the filter passing direction

vzhouwenmsft_3-1713322362670.png

2.Use the following DAX expression to create a measure

Measure = CALCULATE(SELECTEDVALUE('Fact - order'[Product]),USERELATIONSHIP('Fact - order Parts'[order_wid],'Fact - order'[order_wid]))

3.Final output

vzhouwenmsft_4-1713322468145.png

vzhouwenmsft_5-1713322482511.png

vzhouwenmsft_9-1713322573465.png

vzhouwenmsft_10-1713322591161.png

vzhouwenmsft_11-1713322601322.png

vzhouwenmsft_12-1713322625012.png

 

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

 

 

 

Cperota
New Member

did you try lookup function ?>> The lookup   function is a good option when you need a single column.
https://www.sqlbi.com/articles/lookup-multiple-values-in-dax/

thanks, @Cperota

The table 2  'Fact - order Parts' is the one that need to get the column string values 'commodity description' from table 1 'Fact - order'.


To avoid inaccurate calculations, 
I am trying to  do it without USERELATIONSHIP function active /not active stage.
 

Column (inactive) =

ADDCOLUMNS (
'Fact - order Parts',
"commodity_desc",
VAR order_wid_ =
'Fact - order Parts'[order_wid]  //----->my issue here - I have mutiple wo_id
RETURN
LOOKUPVALUE (
'Fact - order'[commodity_desc],
'Fact - order'[order_wid], 'Fact - order Parts'[order_wid],
'Fact - order'[order_wid], order_wid_
) ,
"TREATAS connection",
VAR A_treatas =
TREATAS( VALUES('Fact - order'[order_wid]), 'Fact - order Parts'[order_wid])
RETURN
A_treatas
)

-------------------------------------------

note: I am having proble to answer @Anonymous . I dont understand my message keep be deleted it.

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.