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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
xcrmadmin
Helper I
Helper I

Condition formation per month column

Dear Experts
I Am try to format each coulmn in power bi matrix based on the max to min value as gradient color. I did my best and the result not coming as expected. My matrix inlcude monthes and per each month there are values i need to condition formating it per month to spot the max to min values as gradient color (starting from max value until reach the min value)

 

2023-03-15_15-59-24.jpg

 Anyone can help me for measure that can check each month column to formation color the Max to Min as gradient color.

Regards, 

 

 

7 REPLIES 7
v-cgao-msft
Community Support
Community Support

Hi @xcrmadmin ,

 

Something similar to this. Please see if this helps.

vcgaomsft_0-1679989431299.png

Highlighting the minimum and maximum values in a Power BI matrix

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

xcrmadmin
Helper I
Helper I

I would like to know if someone has ever done the highlighting of Min & Max value for each COLUMN in a matrix visual. I am able to find the max & min values for the entire matrix but not able to figure out a way to highlight the max & min for each COLUMN not row.

UPDATE

i found some one asked for same question but for row not column and when i tried it its work fine per row, but my target is to apply it on or per coulumn 
Highlight Min & Max Values for each Row in matrix visual - DAX / DAX Calculations - Enterprise DNA F...

VAR Vals = CALCULATETABLE ( ADDCOLUMNS ( SUMMARIZE ( DIM_WON_ANALYTICS, 'Root'[Name EN], 'Services List'[Name EN], 'Date'[UNMMAE] ), "@SalesAmt", [Best Selling Product Value] ), //ALLSELECTED () ALL ( 'Date'[UNMMAE] ) ) VAR MinValue = MINX ( Vals, [@SalesAmt] ) VAR MaxValue = MAXX ( Vals, [@SalesAmt] ) VAR CurrentValue = [Best Selling Product Value] VAR Result = SWITCH ( TRUE, CurrentValue = MinValue, 1, -- 1 for MIN CurrentValue = MaxValue, 2 -- 2 for MAX ) RETURN Result

 

amitchandak
Super User
Super User

@xcrmadmin , if you want to return color based on values  then you need to define gradient color and there can be limited colors

 

example

Switch(true(),
[SLA] = 1 , "Green" ,
[SLA] >= .5 , "Amber" ,
"Red "
)

 

This can be used in the conditional formatting field value option. to make this gradient, one need to lot more condition and color

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

 

this my measure but the result not as expected, and i use this measure to coloring the matrix per month name column.

 

CALCULATE ( SUM ( DIM_WON_ANALYTICS[Actual Revenue] ), ALLEXCEPT ('Date', 'Date'[UNMMAE] ) ) IF ( HASONEVALUE ( 'Date'[UNMMAE] ), CALCULATE ( SUM ( DIM_WON_ANALYTICS[Actual Revenue] ) ), MAXX ( ALLEXCEPT ( 'Date', 'Date'[UNMMAE] ), CALCULATE ( SUM ( DIM_WON_ANALYTICS[Actual Revenue] ) ) ) )

Then i used below meassure but alos the result not as expected 

 

SUMX ( FILTER ( ALL ( 'Date' ), 'Date'[UNMMAE] = SELECTEDVALUE ( 'Date'[UNMMAE] ) ), [Total Sales] )

Thanks brother for your replay, my issue that defoult condition formation in matrix format whole matrix, and what iam looking for is to format each column based on the max and min value. Your replay just format whole matrix and this not my goal. Please let me know how to use Measure that can format each value per each coulmn (Month name)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.