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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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.

Anonymous
Not applicable

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors