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
RAHULBANDI
Helper II
Helper II

How to highlight the maximum and minimum value in a matrix

Hello,

 

I have following Data-set

FISCAL YEAR     MONTH   SALE

FY 19-20JUL850
FY 19-20AUG120
FY 19-20SEP630
FY 19-20OCT9910
FY 19-20NOV4250
FY 19-20DEC320
FY 19-20JAN90
FY 19-20FEB120
FY 19-20MAR580
FY 19-20APR740
FY 19-20MAY690
FY 19-20JUN1140
FY 20-21JUL890
FY 20-21AUG5500
FY 20-21SEP360
FY 20-21OCT210
FY 20-21NOV25
FY 20-21DEC140
FY 20-21JAN780
FY 20-21FEB590
FY 20-21MAR2230
FY 20-21APR2210
FY 20-21MAY1120
FY 20-21JUN130
FY 21-22JUL990
FY 21-22AUG120
FY 21-22SEP540
FY 21-22OCT8810
FY 21-22NOV210
FY 21-22DEC240
FY 21-22JAN360
FY 21-22FEB110
FY 21-22MAR52
FY 21-22APR4410
FY 21-22MAY120
FY 21-22JUN3600

 

i need to highlight the maximum and minimum value in a matrix visual for each fiscal year seperately, having green color for maximum value and red color for minimum value

expected output:

RAHULBANDI_0-1663755553835.png

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@RAHULBANDI I created a color filter like below and used it in conditional formatting. See PBIX file attached below signature:

Color Formatter = 
    VAR __FY = MAX('Table'[FISCAL YEAR])
    VAR __Value = SUM('Table'[SALE])
    VAR __Table = SUMMARIZE(FILTER(ALL('Table'),[FISCAL YEAR] = __FY),[MONTH],"__Sales",SUM('Table'[SALE]))
    VAR __Min = MINX(__Table,[__Sales])
    VAR __Max = MAXX(__Table,[__Sales])
RETURN
    SWITCH(TRUE(),
        __Value = __Max,1,
        __Value = __Min,2,
        0
    )

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Super User
Super User

@RAHULBANDI I created a color filter like below and used it in conditional formatting. See PBIX file attached below signature:

Color Formatter = 
    VAR __FY = MAX('Table'[FISCAL YEAR])
    VAR __Value = SUM('Table'[SALE])
    VAR __Table = SUMMARIZE(FILTER(ALL('Table'),[FISCAL YEAR] = __FY),[MONTH],"__Sales",SUM('Table'[SALE]))
    VAR __Min = MINX(__Table,[__Sales])
    VAR __Max = MAXX(__Table,[__Sales])
RETURN
    SWITCH(TRUE(),
        __Value = __Max,1,
        __Value = __Min,2,
        0
    )

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.