Create a calculated Field and use it in the view instead of Discount and Profit.
When 'Australia' Then [Discount]
When 'New Zealand' Then [Discount]
When 'Turkey' Then [Profit]
Or Simpler if you've only 3 countries:
Both solutions are not working as:
When creating a Calc field, an aggregate function is applying which is adding both Profit & Discount measures.
Any other way ?
What code exactly are you using in calculated field ?
Please create a parameter like below.
then create a calculated field Name dynamic measure like below. then use calcualted field into your view and then click on parameter then show parameter control. It will work as per your requirement.
Please mark this answer as helpful and correct answer if it solve your problem.
Both calculations will return same output as logic is same. What are you expecting in this case ? It is showing Discount for Australia.
I have just showed both the screenshot as I wanted to show both solutions has been tried.
Now I want a solution in such a way that if user select country as "Australia" cumulative discount of only respective country should be shown up, in case of New Zealand only cumulative yearly discount of New Zealand should show up.
When user select "Turkey", instead of discount total yearly profit of Turkey should show up.
I tried to replicate your problem using Superstore Dataset. If you select Central region it will show discount else profit for other regions. Let me know if you need something else.
Superstore_v10.5.twbx 2.2 MB