Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Different background color for subtotal

Hi, is it possible to have different color of background for the subtotal for fiscal year and quarter?

 

  • Hi Anonymous,

     

    Not all the way to the labels but as amitchandak has pointed out, you can do it on the values.

    If you don't want it to be dependent on any measure values as per amitchandak solution, you can do it like this...

    Create a measure, (change the table and field reference to match your data).

     

    Colour =
    SWITCH (
        TRUE (),
        ISINSCOPE ( financials[Date].[QuarterNo] ), "Red",
        ISINSCOPE ( financials[Date].[MonthNo] ), "Green",
        ""
    )
    

     

     

    See gif below and PBIX attached.

    Hope this helps.

5 Replies

  • KNP's avatar
    KNP
    Icon for Super User rankSuper User

    Hi Anonymous,

     

    Not all the way to the labels but as amitchandak has pointed out, you can do it on the values.

    If you don't want it to be dependent on any measure values as per amitchandak solution, you can do it like this...

    Create a measure, (change the table and field reference to match your data).

     

    Colour =
    SWITCH (
        TRUE (),
        ISINSCOPE ( financials[Date].[QuarterNo] ), "Red",
        ISINSCOPE ( financials[Date].[MonthNo] ), "Green",
        ""
    )
    

     

     

    See gif below and PBIX attached.

    Hope this helps.

    • Euser's avatar
      Euser
      Frequent Visitor

      Hi KNP,

      Can we add background color for first coloum also where 2023, monthname is displayed.

       

      Thanks!

       

  • Anonymous , Create a color measure and use isinscope  to color

     

    Switch ( True() ,

    not(isinscope(Date[Month])) && [Measure] <= 10000, "Red",

    not(isinscope(Date[Month])) && [Measure] >= 10000, "green",

    (isinscope(Date[Month])) && [Measure] >= 1000, "green",

    //// Add other

    "Red"

    )

     

    And us that is conditional formatting using field value option, and it should be for both value and total

     

    https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

     

    How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

    • Euser's avatar
      Euser
      Frequent Visitor

      Hi amitchandak 

      Could you please let me know is it possible add background color where  2023,monthname is displayed 

       

      Thanks

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

    Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or accept the helpful suggestions to help others who faced similar requirements.

    If these also don't help, please share more detailed information to help us clarify your scenario to test.

    How to Get Your Question Answered Quickly 

    Regards,

    Xiaoxin Sheng