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
netanel
Post Prodigy
Post Prodigy

Changing the background of a card with Filed Value

Hello friends,
I thought it was simple but I must be missing something
I have a report that compares columns
In the card I want to show that:
If the number is different then the background will be red
And if the number is the same then the background will be green
This is the measure:

Change in OpenQTY = IF( [Sum OpenQTY Line] <> [Sum OpenQTY]  ,"#32CD32","#FF0000")
In the card i select the background and base it on a  field value and base it on the measure
 
In the report I have a currency filter
And as soon as I change a currency I expect the background to change accordingly

Link to file:  https://1drv.ms/f/s!AonyYI-TdspHgUhwngZ6OKvpnSsc

Change color base on filter.JPG
 
 
 
 
 
 
 

Thanks







Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki
1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @netanel ;

I tested for a long time and found that your data are all very long decimals, such as 1.00002 and 1.000015, which are about equal to 1, but they are not equal, so the natural colors are always the same, because they have always been unequal, but they seem to be equal, and you need to change the source data, or round up.

vyalanwumsft_0-1668676537751.png

if we change it.

flag = 
var _a=ROUND( [Sum OpenQTY]-[Sum OpenQTY Line],6)
return IF( _a<>0  ,"#32CD32","#FF0000")

The final show:

vyalanwumsft_1-1668676689966.png

vyalanwumsft_2-1668676715695.png

 


Best Regards,
Community Support Team _ Yalan Wu
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

8 REPLIES 8
v-yalanwu-msft
Community Support
Community Support

Hi, @netanel ;

I tested for a long time and found that your data are all very long decimals, such as 1.00002 and 1.000015, which are about equal to 1, but they are not equal, so the natural colors are always the same, because they have always been unequal, but they seem to be equal, and you need to change the source data, or round up.

vyalanwumsft_0-1668676537751.png

if we change it.

flag = 
var _a=ROUND( [Sum OpenQTY]-[Sum OpenQTY Line],6)
return IF( _a<>0  ,"#32CD32","#FF0000")

The final show:

vyalanwumsft_1-1668676689966.png

vyalanwumsft_2-1668676715695.png

 


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yalanwu-msft 

Thanks, that was really the problem
Everything works fine now

Thanks for the quick reply!








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki
ThomasWeppler
Skilled Sharer
Skilled Sharer

If you choose your measure you can and enter the visualizations options you can often change the colors there. That is how I solve that kind of problems. 

visualizations.png

 

rules.png

 

Is there a reason why you prefer to solve it with Dax?

Hi @ThomasWeppler 
Thanks for the response,
Rule Based on one field and I need to base on two fields,
I am trying to display a difference between a column from table A and a column from table B
That is, if a card from table B is different from the card from table A, then the background is red, otherwise it is green
It is impossible to do such a thing in Filed Value 
Anway thanks!








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki

Just make a measure based on two values and use that.

Measure = if(table1[column1] <> table2[column2], 1,2)

@ThomasWeppler 
This is exactly my Measure in my first Post
Thanks but @v-yalanwu-msft  Find the problem and help me to solve the problem!








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki
v-yalanwu-msft
Community Support
Community Support

Hi, @netanel ;

please provide  your expected result with backend logic and special examples. It is better if you can share a simplified pbix file.


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yalanwu-msft 
Thanks for the response
There is a link to the PBIX file in the first message I sent
I also detailed more in the file








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki

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.