0
votes

I have a data table matrix in power bi showing Dates in Rows and hours in columns and count of customers against them as values. i wanted to highlight all rows of thursday, friday and saturday, so that weekend figures can be compared. Need help in this pls...

the table is in the below format enter image description here

1

1 Answers

0
votes

First you want to create a duplicate (in my case monday - friday (2) that does NOT have a relation to you source table. You want this duplicate table to only show days. This duplicate table needs a relationship with the slicer you are going to use to filter for days enter image description here

In your source table (monday - friday) you want to create the following measure:

Measure = IF(HASONEVALUE('monday -friday (2)'[Day]);
    IF(SELECTEDVALUE('monday -friday (2)'[Day]) = MAX('monday -friday'[Day]); 1; 0);
    IF(ISFILTERED('monday -friday (2)'[Day]) && COUNTROWS(FILTER('monday -friday (2)'; 'monday -friday (2)'[Day] = MAX('monday -friday'[Day]))); 1; 0))

Now you want to create conditional formatting. First create your table with days and values (for the example i did not sort the table. You want to sort your table so it looks better): enter image description here

Then right click on values and select conditional formatting. Select based on rules. and the measure you just created in your source table. for the first option you select "is bigger than or equal to" and give it a value 1. for the second option you select "is smaller than"and give it a value 1000. Choose the color you want your highlights to be. enter image description here

If you now select a day in your filter the value for that day will show the background color you selected! In your case you want to select all days you want to have highlighted. enter image description here

Hope this helps!