Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a table with products. The Product field is dimension in the table.
Product //dimension | Max value //1. measure | Amount //2. measure |
Backpack | 5 | 5 |
Pen | 1 | 1 |
Chalk | 4 | 4 |
Two measure as follows:
1.
Max(Aggr( Sum({< YearMonth={'$(= $(vMaxMonth))'}, [Product] >} total<[Product]> [Amount]),Product)) // bad result in table, good result in KPI
2.
Sum({< YearMonth={'$(= $(vMaxMonth))'} >}[Amount])
I would like to get the table as bellow:
Product //dimension | Max value //1. measure | Amount //2. measure |
Backpack | 5 | 5 |
Pen | 5 | 1 |
Chalk | 5 | 4 |
The 'max value' column should show the higher value for any product in amount measure. I tried to use FirstSortedValue function, but it also failed.
FirstSortedValue(Product, Aggr(Max({< [YearMonth]={'$(= $(vMaxMonth))'}, [Product] >}[Amount]), Product))
Thank you for your help
By Add to all rows, do you intend to add the max amount to all the amount values, or do you want a separate column just showcasing the max(value)?
If its the latter, then Aggr(max(Amount), Product),
If summation is needed as well then, Sum(Aggr(max(Amount), Product))