Forum Discussion
Need Help with conditional formatting in DAX
Dear Users
i want to apply conditional formmating in powerBI same as shown in below table.
i want to highlight only 1 cell in entire matrics . i have tried top 1 and ranx functions but not able to achieve desired result.
thanks in advance.
hi Dhrutivyasa-070 ,
supposing you have a data table like:
Year Month Value 2023 June 500000 2023 June 500000 2022 June 67 2023 July 90 2022 July 10 try
1) plot a matrix visual with year column, month column and a measure like:
Sum = sum(data[Value])2) conditionally formatting the [Sum] field with a measure like:
Color = VAR _max = MAXX(ALLSELECTED(data), [Sum]) VAR _result = IF( [Sum] = _max, "Green") RETURN _resultit worked like:
for more info:
https://databear.com/changing-colours-using-dax-and-conditional-formatting-in-power-bi/
2 Replies
- FreemanZ
Super User
hi Dhrutivyasa-070 ,
supposing you have a data table like:
Year Month Value 2023 June 500000 2023 June 500000 2022 June 67 2023 July 90 2022 July 10 try
1) plot a matrix visual with year column, month column and a measure like:
Sum = sum(data[Value])2) conditionally formatting the [Sum] field with a measure like:
Color = VAR _max = MAXX(ALLSELECTED(data), [Sum]) VAR _result = IF( [Sum] = _max, "Green") RETURN _resultit worked like:
for more info:
https://databear.com/changing-colours-using-dax-and-conditional-formatting-in-power-bi/
- wdx223_Daniel
Community Champion
FormatMeasure=IF([Measure]=MAXX(SUMMARIZE(ALLSELECT(Table),Table[Year],Table[Month]),[Measure]),"green")