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
david_MAS
Frequent Visitor

Conditional Formatting on MySelection Measure

Hi All,

 

I've currently got a setup where a user selects one of 8 options using a slicer and this adjusts a linked Matrix Table dependent on the selection. The table essentially has one Measure in the value field and this is where the problem comes in:

 

As I've only got one measure / value field in use, this is the only field to which I can apply conditional formatting. My issue is that I want to be able to apply *specific* conditional formatting dependent on the selection from the slicer.

 

Code copied below - any help much appreciated.

Selected Metric = 
VAR MySelection = 
SELECTEDVALUE('Select Metric'[Measure])
Return
SWITCH (
TRUE (),
MySelection = "Volumes (Cumulative)",[Volume Cumulative],
MySelection = "Forecast (Cumulative)",[Cumulative Forecast],
MySelection =  "% Forecast Met (Cumulative)", FORMAT ( [Ytd. % Forecast Met], "0.00%" ),
MySelection = "Variance (Cumulative)",[Cumulative Variance],
MySelection = "Volumes (by Month)",[Volumes (by Month)],
MySelection = "Forecast (by Month)",[Forecast (by Month)],
MySelection = "% Forecast Met (by Month)", FORMAT ( [Monthly % Forecast Met], "0.00%" ),
MySelection = "Variance (by Month)",[Variance (by Month)],
[Volumes (by Month)]
)
1 REPLY 1
v-cherch-msft
Employee
Employee

Hi @david_MAS 

 

It seems you may create a measure and use it in conditional formatting like below posts.If it is not your case,please share some data sample and expected output. You can upload the .pbix file to OneDrive and post the link here. Do mask sensitive data before uploading.

https://community.powerbi.com/t5/Desktop/Table-visual-conditional-formatting-to-set-background-color...

https://community.powerbi.com/t5/Desktop/How-to-apply-conditional-formatting-only-for-specific-Categ...

 

Regards,

Cherie

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

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.