Forum Discussion
DAX SUMX REFERENCE ANOTHER TABLE
- 9 years ago
Your original formula wont work because you are missing a calculate to force context transition. Check out my evaluation contexts video here https://exceleratorbi.com.au/my-mdis-presentations/
industryreturn = SUMX ( 'Portfolio', CALCULATE ( AVERAGE ( 'Historical Prices'[Close] ) * ( 'Portfolio'[Shares] ) / ( 'Portfolio'[Cost basis] ) - 1 ) * 'Portfolio'[Shares] ) / CALCULATE ( SUM ( 'Portfolio'[Shares] ) )
It would be easier to help if you could provide some sample data. But take a look at my article here and it may help you. https://exceleratorbi.com.au/use-sum-vs-sumx/
Hi Matt, Thank you for taking time out of your day to help me with my problem! The link you provided in your article was very insightful, although I am still confused how referencing another table works in a sumx function. Here is some sample data, (please let me know if you want the sample data in another format.)
The graph I am trying to make, the value for the last day should be around 18Sample of my historical price tableSample of my Portfolio dataMy current relationship set up between tables