Thanks for the video! I like Patrick's solution better because it's more maintainble to have the color values in a measure rather than buried in each formatting dialog box.
100% I moved to a different workplace and don't have the same set of tools that I would normally use... Power BI is one of the few things that I have available. I really appreciate the power that's under the hood... but it can be so tediousness when you're working on a complex set of transformations only to realize you've gone down the wrong path to your solution and have to rewrite a bunch of stuff... I'm getting RSI on my mouse hand wishing I could open the entire project in VS Code and do a regex find replace
Excellent video! I was faced with this same question a few weeks ago. I went the DAX route, but wrote a switch statement like this: Table Metric (Conditional Formatting) = SWITCH( SELECTEDVALUE('Table Metric'[Table Metric Fields]), "'Metrics'[Metric A]", FORMAT('Metrics'[Metric A], "###,###"), "'Metrics'[Metric B - %]", FORMAT('Metrics'[Metric B - %], "##.#%"), "'Metrics'[Metric C]", FORMAT('Metrics'[Metric C], "###,###") ) Note that I wrapped the Switch values in double quotes. I typed the metric names using intellisense, then added the quotes to all 3 lines at the end. This Table Metric (Conditional Formatting) replaces the field parameter and goes into the values well of my matrix, and I have everything that I wanted. The numbers are formatted appropriately (as percentages or whole numbers), and there is conditional formatting of the metric values. The one downside is that I needed to select one specific measure to conditionally format the table, regardless of which measure was selected. The benefit, compared to this method, is that it allows use of all of the standard conditional formatting options, including gradient conditional formatting. I love your videos and thank you for keeping us up to date and for sharing your incredible knowledge! Cheers!
You absolutely rock !! I did have the idea to look in the visual itself but couldn't see an option so headed off to bed (was working late). Then i saw this video and got up again and went back to work. 2 beautiful solutions, I prefer the clicky version. Thanks guys !!
This is great and has helped with an issue I was having with CF for parameters in a table. Any ideas on how to get this to work in a card visual though?
Thanks for the video, Adam! I was wondering, is there a way we could use SELECTEDMEASURE() function to dynamically select measures and get different colors for conditional formatting. E.g, SELECTEDMEASURE () > 0 , "Green".
I had an issue doing conditional formatting on a field parameter that is used for the rows or columns in a table. But I found that if you add that field to the table manually, set conditional formatting then remove the field (since it's contained in the field parameter), the conditional formatting remains on that columns included in the field parameter.
I'm trying to make this work on my visual, but I have a dynamic X and Y axis and I believe my other dynamic axis is kind of blocking the DAX from working properly. Any assistance would be appreciated!
thanks for this video it is very helpful.... I also have a question I have a power bi report in which I am using multiple datasets and report being refresh in every 15 minutes..... but some of datasets not being update in every 15 minutes so if it is possible to refresh those dataset in different frequency and the dataset updates in every 15 minutes refresh in every 15 minutes.
I figure this out recently too. However I was wondering how to take this further. Support you want different visuals for various FP listed in the slicer, how can this be achieved. So far I though if having multiple FP with synch slicer somehow. You might want bar chart for some items in the slicer list or line graph for others?
that works only when you don't change the measures given to the visual, for example if I have a bar chart that uses a field parameters to remove or add bars, the colors get reset everytime you add or remove a measure...
There’s a hack here. If you want to use the standard PBI conditional formatting.. add the original measure (that you want to format) from your model to your visual alongside your parameter, add your conditional formatting to the measure, then remove the measure from your visual.. you’ll find it sticks when using it in the field parameter too :)
Thank you for the video. Would it be possible to have a different conditional formatting but for the same measure? I would need to differentiate the measure's background color over time (selected field would be Q1, Q2, Q3 and Q4). If anyone could assist, I would be soooo happy.
To calculate the percentages in a table or matrix, SWITCH and ISINSCOPE were used, but now the field parameters (which users can set the number they want and in the order they want) how can it be calculated so that the result is correct when the user adds, deletes and changes the order of the field parameters?
Hello, I have a very important question, I am currently putting together a dashboard and I have two different matrices, one that reflects the sales of last year and one of the current one, I need that if the value of the current matrix has higher values than the previous one, it is green. , otherwise it is red, the problem is that the value field is not a table, it is a measure created that talks about the DispatchRatePercent. How could I do this with conditional formatting
Q: i have a similar problem, pls help. In my value, I have my field parameter. (Total sales of current week, past week, etc). So one measure being field parameter. Then on my bar graph axis, i have my products. However i want to not only highlight current week but different color for each product. How to do this ??
I might go with Patrick's way because I need to display one selection as 'thousands' and another as numbers - say, Invoice Amount and Client Count. And this is for a VISUAL. I can do that with conditional formatting within the table, interestingly enough.
Hi, i need some help on how to conditional format on multi kpi card? I know we can use conditional formatting on normal card. Would be helpful if someone can help
Yours, but I would look for other ways of visualizing this instead. I can't imagine having to do this for each selection, especially if I rely so heavily on filtering via other visuals..
Your videos are excellent, guys! Congratulations!!! I'm still a beginner in DAX and I feel I could accomplish my goal if I do something slightly different. Let me explain... I have 3 Field Parameters (Revenue, Cost, and Gross Profit) and 1 bar chart where the user may see 3, 2, or 1 of the measures. I want to color the bar according to the parameter chosen. For example, if the user selects Revenue, make the bars green, if the user selects Cost, make the bar orange, otherwise (Gross Profit) make it blue. Could someone help me, please?
hey so I know it's been a year already but I just noticed that the dax code in the video doesn't work. You may notice that the values that should be formatted the same color are not. This is because ISSELECTEDMEASURE returns false which makes the entire thing default to _tq.
Thanks for the video! I would use DAX because "real developers" use DAX. Of course, I'm kidding. I would lean toward DAX because I'm learning it and I like writing code.
Thanks for the video! I like Patrick's solution better because it's more maintainble to have the color values in a measure rather than buried in each formatting dialog box.
100%
I moved to a different workplace and don't have the same set of tools that I would normally use... Power BI is one of the few things that I have available.
I really appreciate the power that's under the hood... but it can be so tediousness when you're working on a complex set of transformations only to realize you've gone down the wrong path to your solution and have to rewrite a bunch of stuff... I'm getting RSI on my mouse hand wishing I could open the entire project in VS Code and do a regex find replace
Excellent video! I was faced with this same question a few weeks ago. I went the DAX route, but wrote a switch statement like this:
Table Metric (Conditional Formatting) =
SWITCH(
SELECTEDVALUE('Table Metric'[Table Metric Fields]),
"'Metrics'[Metric A]", FORMAT('Metrics'[Metric A], "###,###"),
"'Metrics'[Metric B - %]", FORMAT('Metrics'[Metric B - %], "##.#%"),
"'Metrics'[Metric C]", FORMAT('Metrics'[Metric C], "###,###")
)
Note that I wrapped the Switch values in double quotes. I typed the metric names using intellisense, then added the quotes to all 3 lines at the end.
This Table Metric (Conditional Formatting) replaces the field parameter and goes into the values well of my matrix, and I have everything that I wanted. The numbers are formatted appropriately (as percentages or whole numbers), and there is conditional formatting of the metric values.
The one downside is that I needed to select one specific measure to conditionally format the table, regardless of which measure was selected. The benefit, compared to this method, is that it allows use of all of the standard conditional formatting options, including gradient conditional formatting.
I love your videos and thank you for keeping us up to date and for sharing your incredible knowledge!
Cheers!
Absolute Saviour! love it
I love that video. And I love that Matthias guy.
Thank you so much !!! This saved me hours of searching the internet for a solution !!!!
You absolutely rock !! I did have the idea to look in the visual itself but couldn't see an option so headed off to bed (was working late). Then i saw this video and got up again and went back to work. 2 beautiful solutions, I prefer the clicky version. Thanks guys !!
Fantastic to come here and find the exact solution I needed. Thanks guys!!
I tried to do this same exercise but with a bar graph but it didn't work. Anyway thank you very much!!
Thanks Adam: defintely your way!!!
This is great and has helped with an issue I was having with CF for parameters in a table. Any ideas on how to get this to work in a card visual though?
4:30 For the choropleth maps visual that method does not work :(
Hello and tnx for a great video. Is there a chance to change color of the parameter button itself?
Thanks for the video, Adam! I was wondering, is there a way we could use SELECTEDMEASURE() function to dynamically select measures and get different colors for conditional formatting. E.g, SELECTEDMEASURE () > 0 , "Green".
You guys are freakishly amaaaazinnnnnggggggg!!!!!🙇🙇🙇
Interesting. I thought ISSELECTEDMEASURE only works in Calculation groups. How is it working inside a normal measure ?
Gotta go with Patrick's way on this one 🙂
Which one is better performance wise?
Excellent video!! Is it possible to add a minigraphic for a field parameter? Im a fan of sparklines and it would be amazing to be able tu use this.
Thanks Adam.! I would say like with anything it depends
I had an issue doing conditional formatting on a field parameter that is used for the rows or columns in a table. But I found that if you add that field to the table manually, set conditional formatting then remove the field (since it's contained in the field parameter), the conditional formatting remains on that columns included in the field parameter.
is there a way to make the conditional formatting change depending on what filters are selected?
I'm trying to make this work on my visual, but I have a dynamic X and Y axis and I believe my other dynamic axis is kind of blocking the DAX from working properly. Any assistance would be appreciated!
Both ways are great!
Awesome 2 ways to achieve Conditional Formatting. Let me know Performance wise which approach is better. Is it click or DAX.
Thanks for the tip!
Anyone here been able to figure out c.formatting on other visuals? (ie. Pie charts, bar graphs)
Can formatting be done with a local measure? When connecting to an aas tabular instance aswell. I tried and the measures were greyed out.
thanks for this video it is very helpful....
I also have a question I have a power bi report in which I am using multiple datasets and report being refresh in every 15 minutes.....
but some of datasets not being update in every 15 minutes so if it is possible to refresh those dataset in different frequency and the dataset updates in every 15 minutes refresh in every 15 minutes.
Cool. Thanks guys!
I figure this out recently too. However I was wondering how to take this further. Support you want different visuals for various FP listed in the slicer, how can this be achieved. So far I though if having multiple FP with synch slicer somehow. You might want bar chart for some items in the slicer list or line graph for others?
Hey, trying to connect a parameter to a slicer for dynamic loading of my data right now. Somehow nothing i tried is working thus far - any ideas?
Patrick's solution better when you use different what if for each measure.
that works only when you don't change the measures given to the visual, for example if I have a bar chart that uses a field parameters to remove or add bars, the colors get reset everytime you add or remove a measure...
There’s a hack here. If you want to use the standard PBI conditional formatting.. add the original measure (that you want to format) from your model to your visual alongside your parameter, add your conditional formatting to the measure, then remove the measure from your visual.. you’ll find it sticks when using it in the field parameter too :)
How can we use this measure to conditionally format col/row totals as well ?
Thank you for the video. Would it be possible to have a different conditional formatting but for the same measure? I would need to differentiate the measure's background color over time (selected field would be Q1, Q2, Q3 and Q4). If anyone could assist, I would be soooo happy.
To calculate the percentages in a table or matrix, SWITCH and ISINSCOPE were used, but now the field parameters (which users can set the number they want and in the order they want) how can it be calculated so that the result is correct when the user adds, deletes and changes the order of the field parameters?
Thanks for the video! help me a lot!
Hello, I have a very important question, I am currently putting together a dashboard and I have two different matrices, one that reflects the sales of last year and one of the current one, I need that if the value of the current matrix has higher values than the previous one, it is green. , otherwise it is red, the problem is that the value field is not a table, it is a measure created that talks about the DispatchRatePercent. How could I do this with conditional formatting
Can we do the same in filled maps?
Awesome, Can you calculate a Top N or summarize on Field Parameters to create a tool tip or to write a summary? If so, can you do a video?
Q: i have a similar problem, pls help. In my value, I have my field parameter. (Total sales of current week, past week, etc). So one measure being field parameter. Then on my bar graph axis, i have my products. However i want to not only highlight current week but different color for each product. How to do this ??
What about basing it on a calculation item?
What should we do, if we have Boolean Values "True/False" ?
I like both of you guys... But for this.. I will take your suggestion Adam.. 🙂🙂
Kindly provide DAX based scenarios questions to practice or any url links related to it
Team Patrick 🖤
Patrick's solution is not working on Azure Maps bars.. When you go through each selection, the conditional formatting resets.
Thank you !
Great video, depends on the need of the user, if the target is variable or a measure, DAX feels to be the way to go ;)
I might go with Patrick's way because I need to display one selection as 'thousands' and another as numbers - say, Invoice Amount and Client Count. And this is for a VISUAL. I can do that with conditional formatting within the table, interestingly enough.
Field parameters will retain the metrics' format either way.
But it's only for one measure how we add for all measures in one go
Hi, i need some help on how to conditional format on multi kpi card?
I know we can use conditional formatting on normal card.
Would be helpful if someone can help
I would use Patrick's way if the conditional formatting is applied to multiple visuals, so I may reuse the logic.
Yours, but I would look for other ways of visualizing this instead. I can't imagine having to do this for each selection, especially if I rely so heavily on filtering via other visuals..
I am a fan of the clicky-clicky way
I figured this out when I was trying to add Select All to the Field Parameters
Your videos are excellent, guys! Congratulations!!!
I'm still a beginner in DAX and I feel I could accomplish my goal if I do something slightly different. Let me explain... I have 3 Field Parameters (Revenue, Cost, and Gross Profit) and 1 bar chart where the user may see 3, 2, or 1 of the measures. I want to color the bar according to the parameter chosen. For example, if the user selects Revenue, make the bars green, if the user selects Cost, make the bar orange, otherwise (Gross Profit) make it blue.
Could someone help me, please?
Hi I am also into this and couldn't find a solution, have you found a solution and could you share with me please?
hey so I know it's been a year already but I just noticed that the dax code in the video doesn't work. You may notice that the values that should be formatted the same color are not. This is because ISSELECTEDMEASURE returns false which makes the entire thing default to _tq.
Hi yes! it is returning only false. Did you find any other way to make this work?
@priyadarshinielumalai6024 it should work while using calculation groups I guess. Otherwise two different conditional formatting measures
@@kfasekk I just made it to work with selected value instead of isselectedmeasure
The challenge is now to make it works with calculation group AND field parameters 😉
Thanks for the video! I would use DAX because "real developers" use DAX. Of course, I'm kidding. I would lean toward DAX because I'm learning it and I like writing code.
$1 in the jar
Plus ISSELECTEDMEASURE does not work any more
I choose crazy DAX everytime
based on my situation i will go the Dax way
Definitely clicks (sorry, Patrick)!
I have a field parameter with 1K measures :D and doing it for each of them :( OMG!
Sir
$1
clicks, all day....
I find your lack of faith in DAX disturbing.