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.
Hi all,
Will very appreciate help building the following visual in PowerBi:
Matrix that looks like below:
Group1 | Group2 | Group3 | Group4 | |
Class1 | 25 | 35 | 45 | 25 |
Class2 | 15 | 65 | 25 | 45 |
Class3 | 16 | 28 | 15 | 14 |
Class4 | 19 | 17 | 19 | 19 |
Class5 | 24 | 23 | 35 | 39 |
I need to highlight with the background colour focus Class-Group combinations. E.g. Class2 in Group1 is focus, so I need to highlight cell with value 15 - the condition would be "if class variable is equal class2 and group variable is equal group1 then value should be highlighted with green"
If I understand correctly, it can be possible to do with DAX + conditinal formatting but coulnd't unfortunately find any example.
May be anyone has something similar to share?
Solved! Go to Solution.
@username777 , Not very clear.
But you can create a color measure and use that in conditional formatting using "Field Value" Option
example measure
Color = if(FIRSTNONBLANK('Table'[Year],2014) <=2016 && AVERAGE(Sales[Sales Amount])<170
,"lightgreen",if(FIRSTNONBLANK('Table'[Year],2014)>2018,"red","yellow"))
Color sales = if([Sales Today] -[sales yesterday]>0,"green","red")
color =
switch ( true(),
FIRSTNONBLANK('Table'[commodity],"NA") ="commodity1" && sum('Table'[Value]) >500,"lightgreen",
FIRSTNONBLANK('Table'[commodity],"NA") ="commodity2" && sum('Table'[Value]) >1000,"lightgreen",
// Add more conditions
"red"
)
refer : https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
@username777 , Not very clear.
But you can create a color measure and use that in conditional formatting using "Field Value" Option
example measure
Color = if(FIRSTNONBLANK('Table'[Year],2014) <=2016 && AVERAGE(Sales[Sales Amount])<170
,"lightgreen",if(FIRSTNONBLANK('Table'[Year],2014)>2018,"red","yellow"))
Color sales = if([Sales Today] -[sales yesterday]>0,"green","red")
color =
switch ( true(),
FIRSTNONBLANK('Table'[commodity],"NA") ="commodity1" && sum('Table'[Value]) >500,"lightgreen",
FIRSTNONBLANK('Table'[commodity],"NA") ="commodity2" && sum('Table'[Value]) >1000,"lightgreen",
// Add more conditions
"red"
)
refer : https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
Thanks a lot! This helped me to do what I wanted.
Do you know if it is possible now to count somehow the amount of cells that are of particular color?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
61 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |