Forum Discussion

bklyn3's avatar
bklyn3
Icon for Advocate II rankAdvocate II
4 years ago
Solved

Average value based on two columns in another table

Hello PowerBI community   I have two tables PreviousOrders and FutureOrders.   PreviousOrder Facility Processing Time OrderType A 13 Express A 15 Normal B ...
  • tamerj1's avatar
    4 years ago

    Hi bklyn3 

    you build a many to many relationship between the two tables based on the facity column. Then New column

    AVERAGEX (

    FLITER (

    RELATEDTABLE ( PreviousOrder ),

    PreviousOrder[OrderType] = FutureOrders[OrderType] 

    ),

    PreviousOrder[Processing]
    )