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,
There are many topics about conditionnal formating but I didn't found what I was looking for. Maybe you can help me.
I have a matrice representing % (issued from a measure) through time.
I have a slicer which allow the user to display the % category he want to check.
Each category of this slicer has a target max identified.
I would like to have in my matrice green background when % is under the target and red when it is over.
Thank you for your help.
Solved! Go to Solution.
Hi @sebastienke ,
In this case you need to use a measure similar to this one:
Formatting =
SWITCH (
TRUE (),
SUM ( 'Table'[Value] ) >= MAX ( Target[Target_Max] )
&& SELECTEDVALUE ( 'Table'[Cat] ) IN VALUES ( Target[Cat] ), "Green",
SUM ( 'Table'[Value] ) <= MIN ( Target[Target_Max] )
&& SELECTEDVALUE ( 'Table'[Cat] ) IN VALUES ( Target[Cat] ), "Red"
)
In this case I have used everything on the same table:
But it will work properly if you use a slicer.
Looking at the information you are providing I believe ytou need to use the same measure that you use for changing the calculation based on your target but add the MAX / MIN target value part.
If you are not abble to convert the measure to what you need 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êsHi @sebastienke ,
In this case you need to use a measure similar to this one:
Formatting =
SWITCH (
TRUE (),
SUM ( 'Table'[Value] ) >= MAX ( Target[Target_Max] )
&& SELECTEDVALUE ( 'Table'[Cat] ) IN VALUES ( Target[Cat] ), "Green",
SUM ( 'Table'[Value] ) <= MIN ( Target[Target_Max] )
&& SELECTEDVALUE ( 'Table'[Cat] ) IN VALUES ( Target[Cat] ), "Red"
)
In this case I have used everything on the same table:
But it will work properly if you use a slicer.
Looking at the information you are providing I believe ytou need to use the same measure that you use for changing the calculation based on your target but add the MAX / MIN target value part.
If you are not abble to convert the measure to what you need 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êsActually the problem was not the measure Formatting (even if SWITCH is actually a better solution than mine), but how to use it in the conditionnal formatting parameters. Thanks to your example file, i was able to do what i wanted to !
Thanks @MFelix
@sebastienke What i understand from above that you wish to have conditional formating basis the slicer selection. You want to these 4 slicers value to change the conditional formating. However, looking at your Target Min and Target Max it has comma seperated values. Please tell me how will you have conditional formatting for such values. If possible please share your powerbi sample file with more details.
Proud to be a Super User!
coma is my decimal separator. So 0,05 means 5%.
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 |
---|---|
112 | |
97 | |
82 | |
67 | |
61 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |