Forum Discussion
Maggi029
4 years agoHelper II
How to plot maximum/minimum value plot for selected item's category
Table 1: Date Item Sales Amount 10/01/2021 Apple 300 10/02/2022 Orange 700 20/03/2022 Carrot 300 21/03/2022 Onion 800 Table 2: ...
- 4 years ago
Try the following change:
Maximum = VAR CategorySelection = VALUES( TableDimension[Category] ) RETURN CALCULATE ( MAX ( Table[Sales] ), FILTER ( ALL ( TableDimension ), TableDimension[Category] in CategorySelection ) ) - 4 years ago
Hi Maggi029 ,
Try to change the metric of the max/min to somwething similar to this:
Maximum = VAR CategorySelection = VALUES( TableDimension[Category] ) var ItemValues = CALCULATE ( DISTINCTCOUNT ( Table[Item] ), FILTER ( ALL ( TableDimension ), TableDimension[Category] in CategorySelection ) ) RETURN IF(ItemValues > 1, CALCULATE ( MAX ( Table[Sales] ), FILTER ( ALL ( TableDimension ), TableDimension[Category] in CategorySelection ) ) )This should return blank for the maximum and minimum when there is only a single value so the labels will not appear.
MFelix
4 years agoSuper User
Hi Maggi029 ,
Try to change the metric of the max/min to somwething similar to this:
Maximum =
VAR CategorySelection =
VALUES( TableDimension[Category] )
var ItemValues = CALCULATE (
DISTINCTCOUNT ( Table[Item] ),
FILTER ( ALL ( TableDimension ), TableDimension[Category] in CategorySelection )
)
RETURN
IF(ItemValues > 1,
CALCULATE (
MAX ( Table[Sales] ),
FILTER ( ALL ( TableDimension ), TableDimension[Category] in CategorySelection )
)
)
This should return blank for the maximum and minimum when there is only a single value so the labels will not appear.
Maggi029
4 years agoHelper II
MFelix Can you please look into this and provide your suggestion for this
How to find the maximum value of a measure in tabl... - Microsoft Power BI Community