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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
    )

 


Follow on LinkedIn
@ 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
    )

 


Follow on LinkedIn
@ 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.