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
unclejemima
Post Patron
Post Patron

Cards with states...States for positive or negative number

I'm using the custom visual "Cards with states" and having a difficult time setting the states.

 

The card looks correct (example below) 

cards with states 1.png

What I'm trying to do is simple.  If the target value is a negative -5 to 0% difference, then show yellow.  If its more than -5%, then show red.  If its, positive 0-5%, then show yellow, if its more than 5% positive, then show green.

 

This is default for a normal KPI card, but it seems I can only select one direction for the states...either less than for all states, or greater than for all states.  I can't select one state less than, one state greater than.

 

Help please!

7 REPLIES 7
v-danhe-msft
Employee
Employee

Hi @unclejemima,

Based on my test, you can refer to below steps:

1.I have entered some sample data like the picture below:

1.PNG

2.Create different calculated columns for different State.

StateA=0.5

StateB=0

StateD=-1

StateC=0.5

2.PNG

3.Create a Cards with states visual and set the different color for different states.

3.PNG

Now you can see the correct result.

B1.PNG

You can also download the PBIX file to have a view.

https://www.dropbox.com/s/6ikztpir3m7xitr/Cards%20with%20states...States%20for%20positive%20or%20neg...

 

Regards,

Daniel He

 

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

v-danhe-msft, are you able to enter these values manually and have it work?

Hi @unclejemima,

Based on my test, I entered the value manually and could not get the correct result, I suggest you to create different calculated columns of each value or create different measures of each value, both of them could get waht you want.

Sample pbix:

https://www.dropbox.com/s/8xklro8vxc3fj2v/Cards%20with%20states...States%20for%20positive%20or%20neg...

 

Regards,

Daniel He

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

Based on my test, I entered the value manually and could not get the correct result,

 

Its kind of odd that it does not accept the manual values?  But yes I will try as you suggest. Thank you!

Anonymous
Not applicable

Hi guys,

 

I've made this visual work properly for my need. I created a new measure to calculate the difference between two dates and would like to evaluate this value:

 

_dateDiff = AVERAGEX(dLancamentos, IF(DATEDIFF(dLancamentos[DATA LANCAMENTO], dLancamentos[CREATED ON], DAY) < 0, 0, DATEDIFF(dLancamentos[DATA LANCAMENTO], dLancamentos[CREATED ON], DAY)))

 

In the CardWithValues, I inserted this new measure in the following fields:

 

  • Measure
  • States Measure

In Format >> States, I did this configuration:

 

Affect

Both Labels

 

Messages

On

 

Comparison

<=

 

State A value

3

 

State B value

5

 

State C value

7

 

State D value

80

 

cardwithvalues configuration.png

 

 

stateA.pngstateB.pngstateC.png

 

 

I've noticed if you don't set a value in your previous comparison, the visual assumes the A state, wich is totally wrong - it should apply the higher one.

 

I hope this help you guys. If you have any questions, please, let me know and I'll be glad to help.

 

Kindest regards.
Rafael Belizário Barbosa

Perhaps I'm doing something wrong...but if I try and manually input values, it does not seem to work.  See attached...

STATES example.png

Can you try for your example to manually put in values?  Also your example does not show "Value Type".  Mine is selected as Pecentage over targe what I'm trying to relate to.


So in the example, anything less than -5.1% should be red.  Its showing yellow.

 

Thank you kindly 🙂

Anyone?   Is it not possible to key in the values manually and have this work?

If someone could make suggestions based on my screenshots would be fantastic!

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.