Forum Discussion

lovishsood1's avatar
lovishsood1
Resolver I
4 years ago
Solved

Highlight Weekends on Matrix Visual

Hey!
 I have one Matrix Visual as : 

Column Header: Date Table (Calendar)

Row Header: Table 1

Values: Table 2(Calculated Column)

 

I have applied Conditional Formatting on Values (Background color) via Field Value Formatting Style.

 

Now, I also want to highlight Weekends

 As you can see 15 and 16 January are Sat & Sun. So I want to highlight them with another color but as Conditional Formatting is already applied on Values 15&16 Jan are getting highlighted with given colors. 

In Conditional Formatting , I have set this for BG Colors :
ValuesColor = SWITCH(TRUE(),
_Table2[_Total]=" ","
Yellow",
_Table2[_Total]="AM","
Purple",
_Table2[_Total]="PM","
Purple"
)

How I can highlight Weekends on Columns Headers and Values as well with a specific Color?

  • Hi lovishsood1 

     

    Try using this measure for conditional formatting instead. I put your ValuesColor column in it. 

    ColorMeasure =
    IF (
        WEEKDAY ( SELECTEDVALUE ( 'Date'[Date] ), 2 ) >= 6,
        "Green",
        SELECTEDVALUE ( 'Table 2'[ValuesColor] )
    )
    

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

6 Replies

  • lovishsood1 , You can create a color measure or can merge this code with another color measure 

     

    Switch(True() ,

    Weekday(max('Date'[Date]),2) >=6, "Yellow",

    "Green"

    )

     

    Use this in conditional formatting using field value option

    • lovishsood1's avatar
      lovishsood1
      Resolver I

      I have Calculated Column of colors  in Table 2 so I'm not able to fetch the Date Table there.

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi lovishsood1 

     

    Try using this measure for conditional formatting instead. I put your ValuesColor column in it. 

    ColorMeasure =
    IF (
        WEEKDAY ( SELECTEDVALUE ( 'Date'[Date] ), 2 ) >= 6,
        "Green",
        SELECTEDVALUE ( 'Table 2'[ValuesColor] )
    )
    

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.