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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Apply measure as "Field value" in Conditional formatting with Live connection

Hello,

I'm trying to add a  conditional formatting for background to Card visualisation.

The goal is to conditionally hide slicer when I have only one value and show when more values are available.

I've found an article how to do that: https://exceleratorbi.com.au/show-or-hide-a-power-bi-visual-based-on-selection/

The problem is that, when I'm trying to add my measure to conditional formatting as a Field value, I cannot do that. There is no reaction for my selection.

I use Live connection. In different project without Live connection the same formula works.

My formula for measure:

Make Transparent = IF(ISFILTERED(DimCompany[CompanyDisplayName]); "#FFFFFF00";"White")

I tried also to add this measure to my Analysis Services tabular model, but the effect is the same.

Is there some workaround to conditionally hide slicer with Live connection or do that in a way with conditional formatting?

 

image.png

2 ACCEPTED SOLUTIONS
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

It is impossible to add such measure in the conditional formating as a field when using live connection.

 

Best Regards
Maggie

View solution in original post

Anonymous
Not applicable

I resolve my problem.

I couldn't use my measure which was created in Power BI Desktop with live connection, but it is possible to add this measure to Analysis Services tabular model.

Then I can add the measure (that return hex color) to conditional formatting.

View solution in original post

5 REPLIES 5
mattkocak
Kudo Kingpin
Kudo Kingpin

I believe that the solution that this is impossible with a live connection is false. As others have said, one solution is that you can directly add a measure in the data model.

 

OR you can click on a measure in PBI, go to Measure Tools, and explicitly change the data type to "Text". After doing this, you should be able to select your measure when applying conditional formatting through field values. Here is the original post on this.

 

(change data type of measure to text)

tetra_matt_2-1626973830467.png

 

(the measure is no longer grayed out in conditional formatting)

tetra_matt_3-1626973964301.png

 

Best,

Matt

This may be an old post, but you helped tremendously with this. Thank you Matt!

Anonymous
Not applicable

I resolve my problem.

I couldn't use my measure which was created in Power BI Desktop with live connection, but it is possible to add this measure to Analysis Services tabular model.

Then I can add the measure (that return hex color) to conditional formatting.

Hi,

 

Thanks for this post it worked for me as well:
if model is stored in PBIX you can apply measure as "Field value",
if this live connection to Analysis Services you can apply measure that is inside of the model, 
You do not have to process the model every time you work on the measure just deploy it to the AS and refresh report.

v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

It is impossible to add such measure in the conditional formating as a field when using live connection.

 

Best Regards
Maggie

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.