
1. Re: Max values in rows
Ken Flerlage Feb 14, 2020 3:27 PM (in response to Fattaneh Ameri Mahabadian)So, you have something like this?
If so, we can use an LOD to get the max.
Max Only
// Get the max for this region, year, and category. IF SUM([Quantity]) = MAX({FIXED : MAX({FIXED [Region], YEAR([Order Date]), [Category]: SUM([Quantity])})}) THEN "Keep" ELSE "Exclude" END
The above will first get the sum of the quantity for each combination of the three dimensions (the inner LOD), then find the overall max of those sums (the outer LOD). Then it will compare the sum of each row to that max.
Use this as a filter keeping only "Keep" values. Note: If you have filters, you'll want to rightclick them and add them to context. This will force them to compute before the LOD calculation.

Max Value.twbx 1.2 MB


2. Re: Max values in rows
Bryce Larsen Feb 14, 2020 4:32 PM (in response to Fattaneh Ameri Mahabadian)Hi Fattaneh,
The above calculation should work. Another approach you could look to play with is:
SUM([Units Sold])=WINDOW_MAX(SUM([Units Sold]))
You'll want to compute using Item Type and then filter on True. Just another way that might fit your needs.
Best,
Bryce

3. Re: Max values in rows
Fattaneh Ameri Mahabadian Feb 14, 2020 5:02 PM (in response to Bryce Larsen)Thank you again Bryce.

4. Re: Max values in rows
Fattaneh Ameri Mahabadian Feb 14, 2020 5:03 PM (in response to Ken Flerlage)Thank you Ken

5. Re: Max values in rows
Ken Flerlage Feb 14, 2020 6:24 PM (in response to Fattaneh Ameri Mahabadian)My pleasure!