Hi,
When I select a particular country from slicer, I get the correct result as shown below in the pie chart. I have a green and a red option of pie chart similarly and it all works fine. Green is for positive values and Red is for negative values
But when I select "All" from the slicer, I only get blank image as shown below:
I am using the following measures to show green and red. Eaxmple as follows:
I am struggling with writing the measure for that. How can I show a different color instead when "All" is selected, say orange color?
Thanks for the help!
Solved! Go to Solution.
Hi, @kamsingh11
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create measures as below.
Green =
IF(
HASONEVALUE('Table'[Country]),
IF(
SUM('Table'[Delta])>SUM('Table'[Error Margin]),
1,0
),
0
)
Red =
IF(
HASONEVALUE('Table'[Country]),
IF(
SUM('Table'[Delta])<=SUM('Table'[Error Margin]),
1,0
),
0
)
Orange =
IF(
HASONEVALUE('Table'[Country]),
0,
1
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @kamsingh11
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create measures as below.
Green =
IF(
HASONEVALUE('Table'[Country]),
IF(
SUM('Table'[Delta])>SUM('Table'[Error Margin]),
1,0
),
0
)
Red =
IF(
HASONEVALUE('Table'[Country]),
IF(
SUM('Table'[Delta])<=SUM('Table'[Error Margin]),
1,0
),
0
)
Orange =
IF(
HASONEVALUE('Table'[Country]),
0,
1
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much! I never used HASONEVALUE before. This will be handy for sure!
Hi @kamsingh11
The Card color depends on the name of the country right? if so then you would want to use SWITCH formula.
What are those measures [Delta] , [Error Margin] ?
color card depends on the values represented by Green and Red measures for the selected country. There are several countries. When we select a particular country, color shown by Green and Red measures are fine. But when "All" in Country slicer is selected, the color card becomes blank and I would like it to be some color by creating a new measure that represents "All" in the slicer.
Thanks for your help!
User | Count |
---|---|
421 | |
262 | |
106 | |
93 | |
77 |