Forum Discussion
Calculating value based on another value in same visual
- 6 years ago
Hi , mahoneypat
Is the expected result you provided wrong?
Is this your real expected result?
Please check if the following measure helps.
Compare_Total Actual value = SWITCH ( TRUE (), SELECTEDVALUE ( 'Table 3'[Data] ) = "A", 'Table 1'[Total Actual_value], SELECTEDVALUE ( 'Table 3'[Data] ) = "B", 'Table 1'[S_Total Actual_value] ).....
Here is a sample pbix attached.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Input data
| product | Project value | Actual value | sub category | Count |
| 1 | 12 | 15 | x | 20 |
| 2 | 13 | 12 | x | 20 |
| 3 | 12 | 5 | y | 20 |
| 4 | 11 | 5 | y | 20 |
| 5 | 12 | 18 | z | 20 |
| Data |
| A |
| B |
Default view on pbix - no selection on sub-categories filter
| Data | Total Count | Actual value | Projected value |
| A | 100 | 55 | 60 |
| B | 100 | 55 | 60 |
Expected output on choosing Sub Category values x and z
| Data | Total Count | Actual value | Projected value |
| A | 100 | 55 | 60 |
| B | 100 | 45 | 43 |
Hi , mahoneypat
Is the expected result you provided wrong?
Is this your real expected result?
Please check if the following measure helps.
Compare_Total Actual value =
SWITCH (
TRUE (),
SELECTEDVALUE ( 'Table 3'[Data] ) = "A", 'Table 1'[Total Actual_value],
SELECTEDVALUE ( 'Table 3'[Data] ) = "B", 'Table 1'[S_Total Actual_value]
)
.....
Here is a sample pbix attached.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.