Forum Discussion

bhoyracer123's avatar
bhoyracer123
New Member
29 days ago
Solved

Conditional Formatting Text not recognised in some models

Hi

In all my recent Power BI models, Power BI Desktop recognises text data and lets me put in conditional formatting for text.

Eg if fruit = "Apple" then I can select green background, if "Strawberry" then red etc etc.

 

 

 

I have a model that I have downloaded from our workspace and when I open that in Desktop and add a table visual and add text values to that table, it will not recognise the text and presents the conditional dialogue box with the option of Number or Percent instead.

 

 

Can anyone think what is preventing this model from recognising the text values as text for condtional formatting?

 

The data is in import mode and my Desktop version is from February 2026.

Many thanks

Oliver

 

  • Hi bhoyracer123​ ,

    This isn’t a text data-type issue. In Model view → Model explorer, select the semantic model and check Discourage implicit measures. If it’s enabled and calculation groups aren’t required, turn it off. This should restore text-based rules.
    If the model requires calculation groups, leave it enabled and create a measure returning color names or hex codes, then use Format style → Field value:
    Background Colour =
    SWITCH(
        SELECTEDVALUE('Table'[Fruit]),
        "Apple", "#00B050",
        "Strawberry", "#FF0000"
    )

    Thanks,

    Chaithanya.

13 Replies

  • Hi bhoyracer123​ 

    If you use Rules as the conditional formatting option, it accepts numbers  only. Instead, use a measure as a Field Value in conditional formatting. For example:

    SWITCH (
        SELECTEDVALUE ( data[column] ),
        "apple", "green",
        "strawberry", "red"
    )
    

     

    • bhoyracer123's avatar
      bhoyracer123
      New Member

      that is not quite correct.  Power BI has been accepting text in rules based conditional format for a while now

       

       

  • v-kathullac's avatar
    v-kathullac
    Icon for Community Support rankCommunity Support

    Hi bhoyracer123​ ,

    This isn’t a text data-type issue. In Model view → Model explorer, select the semantic model and check Discourage implicit measures. If it’s enabled and calculation groups aren’t required, turn it off. This should restore text-based rules.
    If the model requires calculation groups, leave it enabled and create a measure returning color names or hex codes, then use Format style → Field value:
    Background Colour =
    SWITCH(
        SELECTEDVALUE('Table'[Fruit]),
        "Apple", "#00B050",
        "Strawberry", "#FF0000"
    )

    Thanks,

    Chaithanya.

    • bhoyracer123's avatar
      bhoyracer123
      New Member

      Love it, that worked!

      Will have a think about the implications, but thanks for posting this!

      Best wishes, Oliver

  • ShahRukhSameer's avatar
    ShahRukhSameer
    Icon for Continued Contributor rankContinued Contributor

    Hi bhoyracer123,

     

    I’ve seen this happen before. The issue usually isn’t with Power BI itself, but with how the column is being recognized in that particular model. If the column isn’t truly typed as Text in Power Query or the data model, the conditional formatting dialog will only offer Number or Percent.

     

    A few things to check:

    • Go into Power Query and confirm the column’s data type is set to Text. Sometimes when you download a model from the service, the type can get inferred differently.

    • If the column is coming from a measure or calculated column, Power BI may treat it as numeric even if the values look like text. In that case, you’ll need to make sure the source column is explicitly Text.

    • Try creating a new table visual with a simple text column from the same model. If that column shows the text formatting options, then the issue is specific to how your field is defined.

    • If you’re still stuck, duplicate the query in Power Query, force the column type to Text, and load that version into the model. That usually resolves the formatting options.

     

    So the short answer is: check the data type of the column in Power Query and the model. If it’s not explicitly Text, Power BI won’t give you the text‑based conditional formatting options. Once you fix the type, the dialog should recognize it properly.

  • Hi Shah, 

    The data in Power Query definitely looks like it is formatted as text:

     

     

    This is common to the whole model.  No text field will work as it should.

     

    Also, the right-click context menu is not as detailed as it is on my other models.

     

      vs 

    Thanks

    Oliver

     

     

     

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

      Unfortunately, the response you're replying to is an unvalidated AI generated response. It is obvious in your screenshot that your column is already a text.

      • bhoyracer123's avatar
        bhoyracer123
        New Member

        Aah, I was wondering (and was getting irritated)!

        Many thanks Danextian!

  • I have just created a brand new table in the same model.

     

     

     

    Don't think I can do a more conclusive test.

     

    Let's start looking at other possibilities.

    Thanks

    Oliver

     

    • ShahRukhSameer's avatar
      ShahRukhSameer
      Icon for Continued Contributor rankContinued Contributor

      Hi bhoyracer123,

       

      It looks like you’ve already done a solid test by creating a brand‑new table with a text column. Since that worked fine, the issue isn’t with Power BI’s ability to recognize text — it’s something specific to the way the original model is set up.

       

      A few possibilities to consider:

      • Check the column’s data category in the model. Even if the type is Text, sometimes the category (like “Uncategorized” vs. “Other”) can affect how visuals treat it.

      • Make sure the column isn’t being pulled in through a measure or calculated column that changes its type. Measures won’t expose text formatting options the same way base columns do.

      • Compare the field properties between the working test table and the problematic one. If the summarization options differ (like “Don’t summarize” missing), that’s a clue the model is treating it differently.

      • Try duplicating the query or re‑importing the source table, then explicitly set the column type to Text before loading. That often resets whatever metadata is blocking the conditional formatting options.

      • If the model was downloaded from the service, it’s possible some metadata got altered in the process. Re‑creating the field locally with the correct type usually fixes it.

       

      Since your test table proves text formatting works in the same environment, the root cause is how the original column is defined in the model. Forcing it to Text again or rebuilding that field should restore the full conditional formatting options.

      • bhoyracer123's avatar
        bhoyracer123
        New Member

        Sorry, " Forcing it to Text again or rebuilding that field should restore the full conditional formatting options."

         

        Hasn't the test with a brand new stand-alone table proved that this isn't the case??