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.
Dear community and P-BI specialists,
I am trying to create a traffic light indicator for some data.
The concerned Excel file contains several columns with data. I want to associate the values of each columne to a range of a traffice light (red, yellow or green) , according to its respective threshold.
Thanks a lot for your help in advance,
Volkmar
Hi @MFelix ,
thanks for your Answer, I can work with that.
Why is there a need to disconnect the tables to grab the values?
BR
You only will need a disconnected table if you want to have single measure for the condittional formatting.
What I mean is that assume you want to have this measure:
Condittional formatting =
SWITCH (
TRUE ();
SUM ( Table[ABC] ) < 1000; "Red";
SUM ( Table[ABC] ) >= 1000
&& SUM ( Table[ABC] ) >= 2000; "Yellow";
SUM ( Table[ABC] ) < 2000; "Green";
SUM ( Table[ZYX] ) < 1000; "Red";
SUM ( Table[ZYX] ) >= 1000
&& SUM ( Table[ZYX] ) >= 2000; "Yellow";
SUM ( Table[ZYX] ) < 2000; "Green"
)
If you use the same table to get the values since you have column ABC and columnZYX in the same table the calculations are picking up the first column you place on the switch measure in this case column ABC so the result would be to have a line with all values equal. In this case you would need to have the disconnected table making the specification that calculations for column ABC would only pick up the column ABC.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHey Miguel,
thanks again for your fast response.
Since I want to use the outcome of the measures for diagrams (e.g. a bar chart), I wonder if I can use those measures, beacuse PowerBI asks for values. So I can't drop this measures in the field value because they contain words and not values ....
I'd like to exhibit the overall amount of the green, yellow and red values ...
What would you suggest?
BR
Hi @Anonymous ,
The measure can be used in any condittional formatting, since when making the use of colours it identifies the Red, Green and Yellow and converts it to colour coding.
however if you want you can customize the colour by adding the HEX codes of your choice you just need to replace the "Red" by "#FFFFFF" the codes must always have the # and 6 characters.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi Miguel,
thanks to your suggestions I was able to create a measure that contains the colors as words.
Unfortunately I can't use it in diagrams, it only allows me to drag & drop the measure in the quickinfo field. Also the conditional formating option doesn't allow to select this measure ....
I also tried to calculate these colors directly in the table as new column. This works fine and it ca be shown in a diagram, because Power BI can count the amount of greens, yellows or reds.
I'd prefer the measure solution, but I can't find the right way to do it. Can you give me any other suggestions?
BR
Hi @Anonymous ,
What do you mean by:
@Anonymous wrote:
Unfortunately I can't use it in diagrams, it only allows me to drag & drop the measure in the quickinfo field. Also the conditional formating option doesn't allow to select this measure ....
....
I'd prefer the measure solution, but I can't find the right way to do it. Can you give me any other suggestions?
You also want to have a count of this values? For that you need a different measure.
Can you share a sample data? and expected result please.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHey Miguel,
I want to evaluate how many values, can be asserted to be red , yellow or green in dependence of the slice selections.
Then these values should be used for diagrams, e.g. a bar stacked bar chart, that exhibist e.g. 10 green, 20 yellow, and 30 red values.
Is it now more clear, what I want?
Tanks & BR
Hi @Anonymous ,
Believe that this can be solved using a measure in PBI no need for the additional columns and this can be done in a dinamic way something similar to:
Condittional formatting =
SWITCH (
TRUE ();
SUM ( Table[column] ) < 1000; "Red";
SUM ( Table[column] ) >= 1000
&& SUM ( Table[column] ) >= 2000; "Yellow";
SUM ( Table[column] ) < 2000; "Green"
)
You can have the values to be dinamic based on a table of thresholds but using this type of measure is sufficient, what I believe is a best practice is to create one for each column you want to have condittional formating, otherwise you will also need to had a disconnect table to pick up the columns.
Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.
If the information is sensitive please share it trough private message.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
80 | |
67 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |