Forum Discussion
Anonymous
8 years agoNot applicable
Composite weight using values from 2 tables.
Hi I have a table in which I have weights assigned to a Country-Product group. For ex. Table A: country Product Weight Australia A 1 Australia X2 0.4388 Brazil X1 0.9763...
- 8 years ago
Somewhat complex challenge you got there. Try this measure, I am not sure I got all your conditions right, if not let me know and I'll rework:
CompositeWeight = VAR AWeight = SUM(TableA[Weight]) VAR ACountry = MAX(TableA[Country]) VAR Prod = MAX(TableA[Product]) VAR NoResponsesCountry = COUNTROWS(FILTER(TableB, TableB[Product] = Prod && TableB[Response Recieved?] = "Y" && ACountry = TableB[Country])) VAR NoResponses = COUNTROWS(FILTER(TableB, TableB[Response Recieved?] = "Y" && ACountry = TableB[Country])) VAR Props = DIVIDE(NoResponsesCountry, NoResponses) VAR X = LEFT(MAX(TableA[Product]), 1) = "X" RETURN IF(X, DIVIDE(AWeight, Props),1)I am assuming here that you would use this in a visual with at least Product and Country as row contexts. I'm using a lot of variables in order to explain, no need for all of that in your work product of course.
erik_tarnvik
8 years agoSolution Specialist
Anonymous
8 years agoNot applicable
erik_tarnvik wrote:No problem. BTW the answer is that Ashish_Mathur filtered the visual on products:
ah, got it !
well that kind-of circumvents the original problem as i need the measure to be used in futher calculations...