Forum Discussion
Matrix conditional formatting if value is lower then previous year then red
- Anonymous6 years ago
Managed to fix it by instead of count using sum in the formale since my table already"counts" the values.
Condittional formatting =SWITCH (TRUE (),SUM('Export'[COUNT] )< CALCULATE (SUM('Export'[COUNT] ),SAMEPERIODLASTYEAR ( DateTable[Date])), "#ff8800")final resultExtra credit to MFelix for all the help provided!
Hi Anonymous ,
This calculation is based on the year basis so because it uses sameperiodlastyear so the needs is not only to change the signal.
Don't know how you have your model setup but you should use something similar to:
CALCULATE (
SUM('Export'[COUNT] ),
FILTER (ALL(DateTable), DateTable[Date] >= Min(DateTable[Date]) - 7 && DateTable[Date] <= Min(DateTable[Date]) - 1
)
I'm assuming you are using dates to the week detail on your visualization.
If not can you please share the sample of your setup.
Thanks for your reply MFelix ! Yes yes I changed the code to suit the weekly period as well so here is a summary of what I'm trying to do
So, I am trying to remove the formatting from the first column. This is essentially weekly quantity of a different products, with products on x axis and weeks on y axis. The idea is to highlight the cell if the value is more (green) or less (pink) than the previous week. I created this measure and applied as field value in conditional formatting.
- MFelix5 years ago
Super User
Hi Anonymous ,
Can you share a sample of your data model?
- Anonymous5 years agoNot applicable
MFelix for some reason Power BI is not allowing me to post it here nor am I able to send you a private message. Please advise
- MFelix5 years ago
Super User
Hi Anonymous
To share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.
If the information is sensitive please share it trough private message.