Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

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:

wad11656_0-1612215984558.png

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



1 ACCEPTED SOLUTION
themistoklis
Community Champion
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")

 

View solution in original post

4 REPLIES 4
themistoklis
Community Champion
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
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?

wad11656_0-1612228277936.png

image.pngimage.pngimage.png

image.png

 

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"

wad11656_0-1612230658087.png

image.png

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

Anonymous
Not applicable

You were right-- The column was in "Text" format.

To change the column to decimal, I first had to use DAX to change columns with "#N/A" or "null" values to 0:

wad11656_1-1612297437867.png

Yes, you are correct: My goal is to apply conditional formatting based on the value of the cell, but the problem is, if you select to perform conditional formatting based on value, you must select a different column to apply the conditional formatting from (the column you're working on is greyed out):

wad11656_0-1612297358361.png

There is also no "Value" option in the "Rules" category:

wad11656_2-1612297568172.png

All of this is actually very perplexing to me: Isn't one of the primary uses of conditional formatting to format cells based on their value? Am I missing something?

My "workaround" to this for past conditional formatting was to create a new column that contains the hex codes for my preferred background color as demonstrated here: https://community.powerbi.com/t5/Desktop/Calculated-Column-with-multiple-IF-Else-Then/m-p/321730/hig... (and then select my HEX-code column when I go to apply conditional formatting by value for my original column in the GUI). But it seems a little silly to need to create an entirely new column with my background colors when I feel the GUI should have the built-in ability to apply conditional formatting based on individual cell value. Ah well, I suppose that is what I must do for now, thank you.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.