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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
zzinoun
Resolver I
Resolver I

Filtering background color through measure

Hi,

 

I have a strange issue when trying to apply a conditionnal background color for a button.

 

I created a measure that calculates the sum of a binary column (1 .  0) and returns 1 if the sum is superior to 1 and 0 if not. 

zzinoun_0-1670009697263.png

Currently this column has only "0" so it is obvious to have a "red" Color 

 

However, this is not the case as the button returns light blue as configured for "1" value. And the most interesting part is the measure returns "0" on Card visual. see image below ;

zzinoun_1-1670009856421.png

How that can be possible ?

 

Note that there is currently no filter applied.

 

Thanks .

1 ACCEPTED SOLUTION
zzinoun
Resolver I
Resolver I

The issue has been solved when i removed the measure to the same table where related columns are ! 

I thought the measure is not impacted with where it has been created ....

View solution in original post

6 REPLIES 6
zzinoun
Resolver I
Resolver I

The issue has been solved when i removed the measure to the same table where related columns are ! 

I thought the measure is not impacted with where it has been created ....

That is correct. While measures have a "host table"  that is not relevant for the computations.

 

Don't conflate "table"  and "table visual"  though - these are different concepts.

Yes I know ! but it was the case for me 

If I were you I would not be satisfied with that. There must be a different reason for the observed behavior.

v-rzhou-msft
Community Support
Community Support

Hi @zzinoun ,

 

Please make sure the binary column is a column in your data model. I think [Bg Color DM ET5] should be a easy measure based on binary column with IF function. Here I create a sample to have a test.

RicoZhou_0-1670220022424.png

Measure:

Measure = 
VAR _SUM = CALCULATE(SUM('Table'[binary]))
RETURN
IF(_SUM>1,1,0)

Background setting:

RicoZhou_1-1670220065530.png

Result is as below. It works.

RicoZhou_2-1670220076250.png

RicoZhou_3-1670220113088.png


Best Regards,
Rico Zhou

 

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

 

 

lbendlin
Super User
Super User

This will depend on the filter context that you have imposed on the button.  Please provide more details, or a sample pbix that demonstrates the issue.

Helpful resources

Announcements
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors