Forum Discussion
How to apply conditional colour formatting to Calculation Groups dynamically with Field Parameters?
How to apply conditional colour formatting to Calculation Groups dynamically with Field Parameters?
Please only reply if you know the answer.
Click here to see example PBIX
It has a Field Parameter for measures:-
- Units sold
- Value of sales
- Packaging cost
- Products sold
Then a Calculation Group with Calculation Items for:-
- TY = this year
- PY = previous year
- YoY = year on year difference (PY – TY)
- YoY% = difference %
The first matrix has Units and conditional colour formatting which works ok if amount is below zero.
The second matrix has Values and conditional colour formatting which works ok if amount is below zero.
The third matrix has a Field Parameter. How can I apply the conditional colour formatting if amount is below zero.
I want to learn how to apply conditional colour formatting to Calculation Groups dynamically with Field Parameters.
Thank you
Click here to see example PBIX
speedrampsPlease use the below measure in the matrix value section instead of field parameter.
Color Measure =VAR _selectedValue = SELECTEDVALUE('Calculation group'[Calculation item])RETURNSWITCH (TRUE(),_selectedValue IN {"PY", "TY","YoY","YoY%"} && MAX('Field parameter'[Parameter Name]) = "Units", [Units],_selectedValue IN {"PY", "TY","YoY","YoY%"} && MAX('Field parameter'[Parameter Name]) = "Value", [Value],_selectedValue IN {"PY", "TY","YoY","YoY%"} && MAX('Field parameter'[Parameter Name]) = "Packaging", [Packaging],_selectedValue IN {"PY", "TY","YoY","YoY%"} && MAX('Field parameter'[Parameter Name]) = "Products", [Products],BLANK() // Default case (no selection))
and then set the conditional formatting as the given picture by right clicking on the color measure. And you are done..Hope this help!!
If this post solved your problem, please mark it as a solution!!
8 Replies
- elitesmitpatel
Solution Supplier
Navigate through the image to reach the setting and understand the rule
Link of solved PBIX
Calculation group colour Solved
Accept it as Solution if it helps you , that will help the community also.
Thanks- speedramps
Super User
Thanks elitesmitpatel I have alreday tried that. It works and mght be the best workaround until PBI develop a better solution. I will accept solutin if noone has a better method.
- ThxAlot
Super User
I doubt such a possibility of the current version of PBI; so far, it's necessary to manually choose the option(s) in this menu for conditional formatting,
- speedramps
Super User
Thanks ThxAlot I have alreday tried that. It works and mght be the best workaround until PBI develop a better solution. I will accept solutin if noone has a better method. 👍
- shafiz_p
Super User
speedrampsPlease use the below measure in the matrix value section instead of field parameter.
Color Measure =VAR _selectedValue = SELECTEDVALUE('Calculation group'[Calculation item])RETURNSWITCH (TRUE(),_selectedValue IN {"PY", "TY","YoY","YoY%"} && MAX('Field parameter'[Parameter Name]) = "Units", [Units],_selectedValue IN {"PY", "TY","YoY","YoY%"} && MAX('Field parameter'[Parameter Name]) = "Value", [Value],_selectedValue IN {"PY", "TY","YoY","YoY%"} && MAX('Field parameter'[Parameter Name]) = "Packaging", [Packaging],_selectedValue IN {"PY", "TY","YoY","YoY%"} && MAX('Field parameter'[Parameter Name]) = "Products", [Products],BLANK() // Default case (no selection))
and then set the conditional formatting as the given picture by right clicking on the color measure. And you are done..Hope this help!!
If this post solved your problem, please mark it as a solution!!- speedramps
Super User
Thank you shafiz_p
I will accept that as a solution but leaving the ticket open for more answers.
Many thanks an well done !
- anamika_singhFrequent Visitor
Hello,
This is a good workaround, however it din't work when i selected multiple measures in the field parameter. It works for single measure selected from the field parameter at a time. Any suggestions on how to fix this issue?
Thanks,
Anamika
- elitesmitpatel
Solution Supplier
Refer the images
1) navigate through image2) Now after clicking on fx . You will see this pop up which says 1) type of condition 2) on which you want to apply and 3 ) here is the condition in which the values which is applied on 2) point which you selected it says that the value > = in % and < 0 in number will have Red colour.
Here is the link Calculating group colour
Please accept it as Solution if it helped you.
Thanks