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.
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, @Anonymous
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, @Anonymous
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 @Anonymous
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] ?
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
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!
Covering 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 |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |