Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
shafiz
Frequent Visitor

How to highlight min and Max in column chart for small multiple and how to solve it

I want to highlight min and max total value in column chart where x axis represent year as well as label (Column in my dataset) used as small multiples. For simple column chart I can acheive it easily but for small multiple I am unable to solve this.

Here is my formula for min and max :


MinMax =

VAR Vals =
    CALCULATETABLE(
        ADDCOLUMNS (
            SUMMARIZE ( Dummy, Dummy[Year],Dummy[Label]),
            "@SalesAmt", [Total]
        ),
        ALLSELECTED ()
    )
VAR MinValue = MINX ( Vals, [@SalesAmt] )
VAR MaxValue = MAXX ( Vals, [@SalesAmt] )
VAR CurrentValue = [Total]
VAR Result =
    SWITCH (
        TRUE,
        CurrentValue = MinValue, 1,
        CurrentValue = MaxValue, 2,
        0
    )
RETURN
IF(ISINSCOPE(Dummy[Label]),
    Result,
    0
)
 

I want to highlight min and max for every label. Is it possible? If possible, kindly guide me towards the solution.


Here is my dummy data :

LabelYearValue

A201113
A201125
A201034
A201533
A201523
A201511
A201655
A201767
A201745
B2011130
B201135
B201036
B201567
B201589
B201590
B201655
B201767
B201745
C2011100
C201170
C201057
C201567
C201589
C201590
C201655
C201767
C201745
D2011130
D201135
D201036
D201567
D201589
D201590
D201655
D201767
D2017200

 

small multiple.png

Here is the image. I want to highlight min and max in each quadrant.

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@shafiz 

I think this is what you are looking for.  Assuming [Total] is a measure that SUMS your Value column.

 

Year Format = 
VAR _YearMin = MINX ( ALLSELECTED ( 'Table'[Year] ), [Total] )
VAR _YearMax = MAXX ( ALLSELECTED ( 'Table'[Year] ), [Total] )
RETURN
SWITCH ( 
    TRUE(),
    [Total] = _YearMin, "Grey",
    [Total] = _YearMax, "Red"
)

 

Make sure this measure data type is Text.

Then this measure get applies and the Columns > Colors conditional format.

jdbuchanan71_0-1689284380771.png

Which gives us this.

jdbuchanan71_2-1689284498764.png

 

 

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@shafiz 

I think this is what you are looking for.  Assuming [Total] is a measure that SUMS your Value column.

 

Year Format = 
VAR _YearMin = MINX ( ALLSELECTED ( 'Table'[Year] ), [Total] )
VAR _YearMax = MAXX ( ALLSELECTED ( 'Table'[Year] ), [Total] )
RETURN
SWITCH ( 
    TRUE(),
    [Total] = _YearMin, "Grey",
    [Total] = _YearMax, "Red"
)

 

Make sure this measure data type is Text.

Then this measure get applies and the Columns > Colors conditional format.

jdbuchanan71_0-1689284380771.png

Which gives us this.

jdbuchanan71_2-1689284498764.png

 

 

 

Thanks @jdbuchanan71 for showing me the right path to acheive this. Exactly this is what I want. 👍

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.