Forum Discussion
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
Microsoft 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
- amitchandak
Super User
mrbajana , Create a new column in Dim table
LineID =maxx(filter(Fact, Dim[Order_id] =fact[Order_id]),Fact[LineID])
- v-xicai
Community 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.