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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RGallagher320
Frequent Visitor

Trying to show text when visual is blank, measures disabled ?

I am following this tutorial to show a message (using card overlay) when a visual is blank.

https://sqlskull.com/2020/09/12/show-or-hide-power-bi-visuals/

 

When I get to the background conditional formatting, it says to select the measure created it before it. However, all my measures are disabled (grayed out)  and cannot be selected. Any thoughts why?

Thanks.

 

RGallagher320_0-1641935746557.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@RGallagher320 , These measure should have data type text. They should return color or hexcode

 

examples

 

Color Date =
var _min =minx(allselected(Date,Date[Year])
return
Switch( true(),
FIRSTNONBLANK('Date'[Year],year(TODAY()))-_min =0 ,"lightgreen",
FIRSTNONBLANK('Date'[Year],year(TODAY()))-_min =0 ,"blue",
"red")

 

 

if(FIRSTNONBLANK('Table'[Value],"true")= "true","green","red")

 

 

if(FIRSTNONBLANK(date[date],blank())= today(),"green","red")

 

if(max(date[date])= tofay(),"green","red")

 

 

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @RGallagher320,

AFAIK, conditional formatting does not work for all types of expressions, you need to use the measure formula which returns the corresponding color text instead of other types of results.

In addition, can you please share some more detailed information about these expressions that grey out?

How to Get Your Question Answered Quickly

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@RGallagher320 , These measure should have data type text. They should return color or hexcode

 

examples

 

Color Date =
var _min =minx(allselected(Date,Date[Year])
return
Switch( true(),
FIRSTNONBLANK('Date'[Year],year(TODAY()))-_min =0 ,"lightgreen",
FIRSTNONBLANK('Date'[Year],year(TODAY()))-_min =0 ,"blue",
"red")

 

 

if(FIRSTNONBLANK('Table'[Value],"true")= "true","green","red")

 

 

if(FIRSTNONBLANK(date[date],blank())= today(),"green","red")

 

if(max(date[date])= tofay(),"green","red")

 

 

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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