Forum Discussion

mrbajana's avatar
mrbajana
Icon for Helper III rankHelper III
6 years ago
Solved

DAX Move Data in Column From Fact Table to Dimension

I need a Calculate Column to move the LineID column from the Fact table to the Dimension Table. This is because I have More tables.

 

 

Thanks

 

  • Just use the RELATEDTABLE function in your new column on the DIM table.

     

    Line ID = CALCULATE(MAX(FACT[LineID]), RELATEDTABLE(Fact))

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

  • mrbajana , Create a new column in Dim table

    LineID =maxx(filter(Fact, Dim[Order_id] =fact[Order_id]),Fact[LineID])

3 Replies

  • mahoneypat's avatar
    mahoneypat
    Icon for Microsoft Employee rankMicrosoft Employee

    Just use the RELATEDTABLE function in your new column on the DIM table.

     

    Line ID = CALCULATE(MAX(FACT[LineID]), RELATEDTABLE(Fact))

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

  • mrbajana , Create a new column in Dim table

    LineID =maxx(filter(Fact, Dim[Order_id] =fact[Order_id]),Fact[LineID])

  • v-xicai's avatar
    v-xicai
    Icon for Community Support rankCommunity Support

    Hi mrbajana ,

     

    You may create column like DAX below in 'DIM_TABLE'.

     

    New_Column= CALCULATE ( FIRSTNONBLANK ( 'Fact Table'[LineID], 1 ), FILTER ( 'Fact Table', 'Fact Table'[Order_ID]='DIM_TABLE'[Order_ID]))

     

    Best Regards,

    Amy 

     

    Community Support Team _ Amy

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