Forum Discussion
split values between not related tables
- 5 years ago
Hi paolomint
Not clear about your data model and table structure, so I create a sample, you may take steps bellow for reference.
-
1.create the GoalTable.
GoalTable = SUMMARIZECOLUMNS(ClientsTable[Agent],ItemGoalTable[ITEM])Result:
2.create the two measures.
Measure_%CLIENTS = VAR _total = CALCULATE ( SUM ( ClientsTable[CLIENTS 2020] ), ALL ( ClientsTable ) ) RETURN DIVIDE ( SELECTEDVALUE ( ClientsTable[CLIENTS 2020] ), _total )Measure_GOAL = VAR _CLIENTS = CALCULATE ( [Measure_%CLIENTS], FILTER ( ClientsTable, ClientsTable[Agent] = SELECTEDVALUE ( GoalTable[Agent] ) ) ) VAR _num = CALCULATE ( SELECTEDVALUE ( ItemGoalTable[GOAL] ), FILTER ( ItemGoalTable, ItemGoalTable[ITEM] = SELECTEDVALUE ( GoalTable[ITEM] ) ) ) RETURN _CLIENTS * _numResult:
You can check the sample file I attached below.
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi paolomint
Not clear about your data model and table structure, so I create a sample, you may take steps bellow for reference.
-
1.create the GoalTable.
GoalTable = SUMMARIZECOLUMNS(ClientsTable[Agent],ItemGoalTable[ITEM])
Result:
2.create the two measures.
Measure_%CLIENTS =
VAR _total =
CALCULATE ( SUM ( ClientsTable[CLIENTS 2020] ), ALL ( ClientsTable ) )
RETURN
DIVIDE ( SELECTEDVALUE ( ClientsTable[CLIENTS 2020] ), _total )Measure_GOAL =
VAR _CLIENTS =
CALCULATE (
[Measure_%CLIENTS],
FILTER (
ClientsTable,
ClientsTable[Agent] = SELECTEDVALUE ( GoalTable[Agent] )
)
)
VAR _num =
CALCULATE (
SELECTEDVALUE ( ItemGoalTable[GOAL] ),
FILTER (
ItemGoalTable,
ItemGoalTable[ITEM] = SELECTEDVALUE ( GoalTable[ITEM] )
)
)
RETURN
_CLIENTS * _num
Result:
You can check the sample file I attached below.
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.