0 votes
1 view
in BI by (43.3k points)

I am pretty new with Tableau and I need your help for a visualization.

I have Col.1 = Country; Col.2 = Product name; Col. 3 = #Sales

I want to make a table that displays for each Country the Product name that has the maximum amount of sales.

E.g.

Country | Product
AT | Shoes

where shoes are the product with max sales.

I had thought of a calculated field like this: if sum[Sales] = max([Sales]) then [Product Name] else Null END but it gives me an error.

Any idea of how to solve it?

Thanks in advance for any help given!

1 Answer

0 votes
by (16.3k points)
  • You need a FIXED LOD to find the MAX(Sales) within Col1 and then output the level within Col2 matching with this MAX(Sales), extending  to your method 

IF ([Sales])== ({FIXED [Cat1]:MAX([Sales])}) THEN [Cat2] ELSE NULL END

  • Then add a Calculated Field to the Filter and filter out the NULL's.

enter image description here

Related questions

+2 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...