Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in BI by (17.6k points)

I have a data with columns called Brand, Market and Target. The Brand having members like A, B, C & D repeats across 2 kinds of Market - OPL and CPL. So the Target for each of Brand and Market also repeats in column Target, as in below image:

enter image description here

All I would want is to get sum of Target for each of Brand at OPL (highlighted in orange) and sum of Target for each of Brand at CPL (highlighted in yellow)

So sum for OPL should be 10000 + 7000 + 4000 + 9000 = 30000 and sum for CPL should be 5000 + 2000 + 8000 + 3000 = 18000

I used a logic like

IF [Market] = 'OPL' THEN {FIXED [Brand]+[Market] : MIN([Target])} END

Image as below:

enter image description here

which gave me total of target at OPL which is 58000, which is not the one I wanted. Please help me with correct calculation, do let me know for any further details.

1 Answer

0 votes
by (22.5k points)
edited by

Use this calculated field

SUM( { FIXED [Brand], [Market]: AVG(Target) } )

Are you a newbie to Tableau? Then join our Tableau Training course. Also, know more about Tableau certification by watching the below YouTube video:

 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 26, 2019 in BI by Vaibhav Ameta (17.6k points)

Browse Categories

...