Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

conditional formatting with multiple columns in a histogram

Hello,

 

I would like to do a conditional formatting on multiple columns of my histogram as follow :

Have all columns after february in grey.

 

It seems I can't manage it in a histogram with more than one column.

 

Thanks,

7 Replies

  • Hi Anonymous 

    Download sample PBIX file with the below data/visual/measure

    If you create a measure that tells you the month you can then set a CF rule to color the columns grey.

    But what exactly do you mean by after Feb?  Are you concerned with only a single year at a time? Is Dec  considered before or after Feb if it's Dec from the previous year?

    Here's the measure

     

    TheMonth = MONTH(SELECTEDVALUE('Table'[Date]))

     

    Under Format -> Data colors click on the fx button and set this rule

     

    Regards

    Phil

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks a lot for your answer and help.

     

    I'am concerned with a single year which means that I want all values after february to be in grey.

     

    However as I have multiple columns, I can't add a Dax measure or conditional formatting... It seems that when using multiple charts, you don't have access to fx button. 

     

    If you have any idea, how to correct it... 

     

  • Anonymous 

    ah I see what you mean now. You meant multipel columns from different series,not from the same series.

    Unfortunately once you have more than one set of values in the column visual you lose the ability to apply conditioanl formatting.

    Regards

    Phil

  • Anonymous's avatar
    Anonymous
    Not applicable

    Unfornately...

    In this case, would you know how to create a specific measure that would enable to have all values after February in blank.

    This is my initial measure : 

    TEST = calculate(totalYTD(sum(UploadFile_CRM_13012020[Montant 2021]),DistinctDate[Date].[Date]),UploadFile_CRM_13012020[Statut]="Clôturée (gagnée)")
    Thanks 
    • v-xulin-mstf's avatar
      v-xulin-mstf
      Community Support

      Hi Anonymous,

       

      What your expected output? If you want to have all values after February showed blank values.

      You can try measure as:

      If(
         Month(Date[Date])>2,
         blank(),
         [Test]
      )

       

      Best Regards,

      Link

      • Anonymous's avatar
        Anonymous
        Not applicable

        It does not work as I can't add a date to It measure.

         

        However I tried the following measure :

        if(month(DistinctDate[Date].[Date])>2,BLANK(),calculate(totalYTD(sum(UploadFile_CRM_13012020[Montant 2021]),DistinctDate[Date].[Date]),UploadFile_CRM_13012020[Statut]="Clôturée (gagnée)"))
         
        But It does not show the YTD cumulated until february. All values from february to end of year are blank.
         
        Any advice ?