Forum Discussion
highlight weekends in matrix
- 6 years ago
Here is one way I found to work.
On your Date table, add a column with this expression
Day Color = IF(WEEKDAY('Date'[Date])=1, "Red")
Then, concatenate the expression in your measure that goes in the values area with & " "
Measure = SUM(Table[Column]) & " "
Then add conditional format to that measure in the matrix, choose Field Value, and your Date[Day Color] field (it will default to First aggregation).
Here is an example I what I saw when I did the above (note one value is blank but still show red).
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
If so, you can use the Day of Week and conditional formatting to highlight the weekends. How do you want the weekends highlighted?
AllisonKennedy , I have workDay as a calculated column in my table. I have no Datetable separately?
amitchandak How having a separate data table will help in this case?
- AllisonKennedy6 years ago
Community Champion
You can use amitchandak 's measure on your existing table, but a separate Date table is highly recommended.
You can also use your WorkDay column as is to do conditional formatting in the matrix, just depends what color you want it and if you also need it to work with the existing conditional formatting you may need to create a custom measure to incorporate both values, so let us know. - amitchandak6 years ago
Super User
Anonymous , If you are using that date in matrix the formula should work
work day = if(WEEKDAY([Date],2)<6,1,0)
- Anonymous6 years agoNot applicable
amitchandak , AllisonKennedy thank you for your replies. but I still have the issue. So let me walk you through what I do:
I add the MonthDay as my column in the Matrix:Then, I add my measure, which is a simple count : (the measure is
COUNT(ExecutionLogStorage[ReportAction])Then I created a color column in my Date table, saying if it is Sunday, then Red, otherwise, white.
Then I set the background color of my measure , with conditioanal formatting and field value of Color column:
the month is June, and it is working.
Now, when I add my Username to my rows, it goes like this :what I want is for the whole columns which represents Sundays, go red. Like 28 should be red totally. Not just where we have value.
So, I tried to add manually value to blank cells with the measure:
InteractionCount = if( ISBLANK(COUNT(ExecutionLogStorage[ReportAction]));-99;COUNT(ExecutionLogStorage[ReportAction]))But, no difference, still the same problem:What am I doing wrong?
- v-lionel-msft6 years ago
Community Support
Hi Anonymous ,
If you have a date column in your table, you can do like this(Please refer to my .pbix file.).
If you don't have a date column in your table, please give me a sample data.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.