Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Conditional formatting with multiple decimals

The software version number in our dataset has multiple decimals, and Power BI does not recognize these version numbers as numbers for conditional formatting:

How can we get it to register as a number?

 

(Also, can we delete the "and" clause?)

 

Sample data:

CompanyComputerVersion
YipeeBACONATOR2.0.1570
TundraALOHA2.0.1560
TundraGRANDPA2.0.1570
YipeeNETHERLANDS2.0.1540



  • Hello Anonymous 

     

    I dont think there is a way to make a record with numbers and 2 decimals to be recognised as number in PowerBI.

     

    I would suggest you check if there is a pattern on software versions. e.g. if you have software version in this format:

    2.0.176

    3.1.033

    2.1.001

     

    Simply delete the second decimal, convert it to number and then apply a conditional formatting

    You can try the following formula:

    Column = FORMAT(REPLACE(Sheet1[Version],4,1,""), "0.0000")

     

4 Replies

  • themistoklis's avatar
    themistoklis
    Community Champion

    Hello Anonymous 

     

    I dont think there is a way to make a record with numbers and 2 decimals to be recognised as number in PowerBI.

     

    I would suggest you check if there is a pattern on software versions. e.g. if you have software version in this format:

    2.0.176

    3.1.033

    2.1.001

     

    Simply delete the second decimal, convert it to number and then apply a conditional formatting

    You can try the following formula:

    Column = FORMAT(REPLACE(Sheet1[Version],4,1,""), "0.0000")

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for the very quick reply ğŸ˜€  I believe your solution would be an acceptable compromise if it worked for me. I applied your suggested new column using DAX. Unfortunately, the conditional formatting does not work at all as expected:

      • "If is blank" does nothing.
      • "If is greather than or equal to 2.11570 and less than 99999" does nothing.
      • "If is greater than 0 and less than 2.11570" marks EVERY cell.🤔

      Did the way we did the FORMAT function change the value format to something that isn't fully compatible with the conditional formatting I'm trying to apply?

       

      Sample data:

      CompanyComputerVersion
      YipeeBACONATOR2.1.1570
      TundraALOHA2.1.1560
      TundraGRANDPA2.1.1570
      YipeeNETHERLANDS2.0.1540
      MattressSKY 

       

      EDIT: It seems it's treating the value of every cell to be "1"

      • themistoklis's avatar
        themistoklis
        Community Champion

        Hello Anonymous ,

         

        I suggest you check couple of things.

        1. When you click on the new field what is the format (datatype) that is shown in PowerBI (Under Measure Tools section on the menu bar? Make sure it is Decimal Number format

        2. I think the way you probably used the conditional formatting is wrong. You use the count of the field (count of Cylance version) and not the actual field values. Please change it and put the field name