Forum Discussion

JUANROVALETTI's avatar
JUANROVALETTI
Frequent Visitor
3 years ago
Solved

conditional formatting in a column chart

HI in my monthly report where the user must select a month i have all my visual affected by that month slicer.

 

But i add one visual where i want to show :
the total spend from the begining of the year ( i have a measure for total spend) 

so i solved it using a column chart  whit de x-axis the dates from my calendar dates and in the y-axis the total spend measure and from (edit interactions) decides to not apply the selected month in that visual.

In the image there is the column chart and over a card that is in intereaction with the month slicer so it is showing the spend from JUNE .

the thing is that i want to apply a conditional formatting to show in the column chart the selected month. its posible??

 

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi JUANROVALETTI ,

     

    I suggest you to create an unrelated calendar table to help your calculation.

    Unrelated DimMonth = CALCULATETABLE('Calendar')

    Measure:

    Month Spend = 
    VAR _SELECTYEARMONTH = SELECTEDVALUE('Unrelated DimMonth'[YearMonth])
    RETURN
    CALCULATE(SUM('Table'[Sales]),'Calendar'[YearMonth] = _SELECTYEARMONTH)
    
    Color = 
    VAR _SELECTMONTH = SELECTEDVALUE('Unrelated DimMonth'[MonthName])
    RETURN
    IF(MAX('Calendar'[MonthName]) = _SELECTMONTH,"Yellow")

    Configure the column color as below.

    Result is as below.

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

7 Replies

  • JUANROVALETTI you can add a measure for the selected month and then use this measure as a title of the column chart:

     

     

    Selected Month = SELECTEDVALUE ( DateTable[Month Column from Slicer] )

     

     

    • JUANROVALETTI's avatar
      JUANROVALETTI
      Frequent Visitor

      okey thanks. but that's not my issue, i want the columns chart have a conditional formatting that change the color only for the selected month. but remember that i disabeled the interaction between the month slicer for the visual. 

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi JUANROVALETTI ,

         

        I suggest you to create an unrelated calendar table to help your calculation.

        Unrelated DimMonth = CALCULATETABLE('Calendar')

        Measure:

        Month Spend = 
        VAR _SELECTYEARMONTH = SELECTEDVALUE('Unrelated DimMonth'[YearMonth])
        RETURN
        CALCULATE(SUM('Table'[Sales]),'Calendar'[YearMonth] = _SELECTYEARMONTH)
        
        Color = 
        VAR _SELECTMONTH = SELECTEDVALUE('Unrelated DimMonth'[MonthName])
        RETURN
        IF(MAX('Calendar'[MonthName]) = _SELECTMONTH,"Yellow")

        Configure the column color as below.

        Result is as below.

        Best Regards,
        Rico Zhou

         

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous Thanks for the answer but not sure why would you reply until there is a reply to my last message. What's the point? There was no feedback if my posted solution didn't work and required further solutions.