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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
siddrow
Helper III
Helper III

Measure for conditional formatting to show 0 instead of blank for card visuals & text colour change

Hi

 

I'm looking for a measure to show 0 instead of blank on my Power BI card visual and also change the text colour regardless if the amount is 0 or more. The issue is my data is text format and i can't change it to number as the column only contains the word "missing" and the card is counting the rows which have that text. 

 

What I'm looking for it a measure that can do this:

 

If the count = "blank" then show 0 in orange OR if the count is more than 0 then show the count in orange.

 

I am very new to measures, so if you could please repsond with the exact measure I need, that would be awesome 🙂

 

thanks in advance 🙂

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @siddrow ,

 

You can refer to the following test procedure:

M_ = 
var sel = SELECTEDVALUE('Slicer_'[Category])
return IF(MAX('Table'[Category])=sel,sel,"0")

vhenrykmstf_0-1648608421981.pngvhenrykmstf_1-1648608440323.png

Also didn't understand your need to show the orange color, but you can probably refer to the following screenshot:

Measure = 
var sel = SELECTEDVALUE(Slicer_[Category])
return IF(MAX('Table'[Category])<>sel,0,1)

vhenrykmstf_2-1648608584894.png

 

If the problem is still not resolved, can you further describe your requirements and provide relevant image information and screenshots of the desired results?


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-henryk-mstf
Community Support
Community Support

Hi @siddrow ,

 

You can refer to the following test procedure:

M_ = 
var sel = SELECTEDVALUE('Slicer_'[Category])
return IF(MAX('Table'[Category])=sel,sel,"0")

vhenrykmstf_0-1648608421981.pngvhenrykmstf_1-1648608440323.png

Also didn't understand your need to show the orange color, but you can probably refer to the following screenshot:

Measure = 
var sel = SELECTEDVALUE(Slicer_[Category])
return IF(MAX('Table'[Category])<>sel,0,1)

vhenrykmstf_2-1648608584894.png

 

If the problem is still not resolved, can you further describe your requirements and provide relevant image information and screenshots of the desired results?


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

jaideepnema
Solution Sage
Solution Sage

Hi @siddrow ,

Use a measure like this 

Count = IF(ISBLANK(COUNT('Dataset'[CountA])),0,COUNT('Dataset'[CountA]))
 
And change the color of callout value of the card visual to Orange to show the values in Orange.
 
Refer the attached file to check the same.
 

Please accept this as a solution if your question has been answered !!

Appreciate a Kudos 😀

Thanks for your quick reply, I appreciate it! 🙂

 

I don't think this one will work as I already have a slicer. The slicer is for different mine sites, so once clicked, it updates the cards to only show what is outstanding for that particular site. Would there be another way to do the measure?

Not sure about your query ...but if the count of the column is blank irrespective of what you select in the slicer this measure should work. Can you check and confirm on the same ?

amitchandak
Super User
Super User

@siddrow , Usually we add +0 for that

 

example measure = Count(Table[Measure])+0

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi

 

Sorry this doesn't really answer my question. I need the full measure for both statements i am trying to do. 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.