Forum Discussion
How to get max value in column chart
- 2 years ago
Hi!
In your "Max Orders Europe 3", remove Orders[Region] and Orders[ShipMode] from summarize so that the table is only grouped by quarter and not by those columns as well. This allows mulitple items to be selected.Max Orders Europe 3 modified = VAR _table = CALCULATETABLE( ADDCOLUMNS( SUMMARIZE(Orders, Dates[Year], Dates[QuarterOfYear] ), "Totaal",[Sum Orders] ), ALLSELECTED(Orders) ) VAR MaxVal = MAXX(_table,[Totaal]) RETURN MaxVal
You should also be able to remove ADDCOLUMNS() and make the measure a bit shorter, but maybe you prefer it that way:Max Orders Europe 3 short = VAR _table = CALCULATETABLE( SUMMARIZE( Orders, Dates[Year], Dates[QuarterOfYear], "Totaal",[Sum Orders] ), ALLSELECTED(Orders) ) VAR MaxVal = MAXX(_table,[Totaal]) RETURN MaxValHope this helps!
Hi!
In your "Max Orders Europe 3", remove Orders[Region] and Orders[ShipMode] from summarize so that the table is only grouped by quarter and not by those columns as well. This allows mulitple items to be selected.
Max Orders Europe 3 modified =
VAR _table =
CALCULATETABLE(
ADDCOLUMNS(
SUMMARIZE(Orders,
Dates[Year], Dates[QuarterOfYear]
),
"Totaal",[Sum Orders]
),
ALLSELECTED(Orders)
)
VAR MaxVal = MAXX(_table,[Totaal])
RETURN MaxVal
You should also be able to remove ADDCOLUMNS() and make the measure a bit shorter, but maybe you prefer it that way:
Max Orders Europe 3 short =
VAR _table =
CALCULATETABLE(
SUMMARIZE(
Orders,
Dates[Year], Dates[QuarterOfYear],
"Totaal",[Sum Orders]
),
ALLSELECTED(Orders)
)
VAR MaxVal = MAXX(_table,[Totaal])
RETURN MaxValHope this helps!
Hi TomasAndersson thnx for helping. It works. I made a mistake in thinking :(.
Still learning DAX, bit by bit. Once again, thnx