Forum Discussion
POWER BI MATRIX
- Anonymous2 years ago
Hi BIswajit_Das ,
Sorry for being late, please change the DAX into this:Measure = var _tab=SUMMARIZE(ALLSELECTED('Sheet18'[RES]),'Sheet18'[RES], "@sumvalue",CALCULATE(COUNT(Sheet18[NUM]))) var _max= maxx( _tab,[@sumvalue]) var _area=SELECTEDVALUE('Sheet18'[RES]) return SWITCH(TRUE(),COUNT('Sheet18'[NUM])=_max&&_area="a","Blue", COUNT('Sheet18'[NUM])=_max&&_area= "b","Black",COUNT(Sheet18[NUM])=_max&&_area="c","Yellow")The final output is below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BIswajit_Das , If you want on Area- a, b, c then you need to use a measure given below in conditional formatting using the field value option
Switch(Max(Table[Area]) ,
"a", "Blue",
"b", "black",
"c", "Yellow",
// add other
"green"
)
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/1682539
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pane-66e0afcb15f3
- BIswajit_Das2 years ago
Impactful Individual
Hello amitchandak thanks for responding.
But If possible can you give an example regarding this query
i. e How to add color formating on a matrix based on the above senario.
Thanks & Regards...- Anonymous2 years agoNot applicable
Hi BIswajit_Das ,
Please refer to the steps:
I create a measure by using this DAX:Measure 2 = var _tab=SUMMARIZE(ALLSELECTED('Table (2)'[area]),'Table (2)'[area], "@sumvalue",CALCULATE(SUM('Table (2)'[value]))) var _max= maxx( _tab,[@sumvalue]) var _area=SELECTEDVALUE('Table (2)'[area]) return SWITCH(TRUE(),sum('Table (2)'[Value])=_max&&_area="a","Blue", sum('Table (2)'[Value])=_max&&_area= "b","Black",sum('Table (2)'[Value])=_max&&_area="c","Yellow")
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- BIswajit_Das2 years ago
Impactful Individual
HelloAnonymous
Thanks for responding but can you edit the measure for this data
PCNONUMRES1 1 A 1 2 A 1 3 B 1 4 A 2 5 B 2 6 C 2 7 A 2 8 B 3 9 C 3 10 A 3 11 C 3 12 C here the measure is like
i.e
In rows - pcnocolumns - res
values - count(num)
Thanks & regards..