Hi. I have a following DAX code to calculate percentage of a component (by dividing quantity of component with total). Table fileds are (ID, quantity, factor and component). I use my DAX code as measure which works great as long as visualisation is based only on this table only but has certain problems when trying to visualize data from other related tables.
VAR Divide =
SUM ( 'Table1'[Quantity]] ),
ALLEXCEPT ( 'Table1', 'Table1'[ID] ),
'Table1'[Component] = "Total"
SUM ( 'Table1'[Factor] ) = 1,
SUM ( 'Table1'[Quantity]] ) / Divide,
I could solve this by adding new column in M code instead of using DAX measure. However, I am having problems with defining it. Can you propose a solution?