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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Introduced Colour and Text Comment for Infinity & NaN

Hi,

 

I want to know if I can make the  cells red for the remaining Infinity values? It worked when I used the background colour for percentage above 1 but not all of them get the red cell. No success for NaN wherein I want to have yellow cells

 

Another question...how can I make a dax for Infinity & NaN to show Text "No PO With Cost" and "No Cost, No PO" respectively?

 

tksnota_0-1732878067274.png

 

tksnota_1-1732878356604.png

 

2 REPLIES 2
dharmendars007
Memorable Member
Memorable Member

Hello @Anonymous , 

Create a new measure to determine the formatting rules like below

Format Measure =
SWITCH(
TRUE(),
ISBLANK([Percentage]), 2, -- Yellow for NaN
NOT ISNUMBER([Percentage]), 3, -- Red for Infinity
1 -- Default (No Formatting))

2 corresponds to yellow (NaN).
3 corresponds to red (Infinity).
Default formatting applies otherwise.


You can also use a calculated column or measure in DAX to replace Infinity and NaN with your desired text like below.

Custom Percentage =
SWITCH(
TRUE(),
ISBLANK([Percentage]), "No Cost, No PO", -- NaN
NOT ISNUMBER([Percentage]), "No PO With Cost", -- Infinity
FORMAT([Percentage], "0.00%") -- Default percentage format)

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 



Anonymous
Not applicable

Hi,

 

Here are the results...

 

The required texts are not being captured...

 

Thanks...tksnota...

 

tksnota_0-1732879730729.png

 

 

tksnota_1-1732879785933.png

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.