Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mtdewrocks
Regular Visitor

Use Parameter value to conditionally format bar chart

How can I use the parameter value to conditionally format a bar chart? I am able to use the following formula to color the bar chart in the way I want - 

Color = if('Raw Player Stats'[PTS]>10, 1, 0). However, if I replace the hard coded value of 10 with the parameter value of 10, it assigns values of 1 to everything. I believe it is aggregating the pts column to a sum, as opposed to looking row by row. Any idea of how I can accomplish this to use my parameter value in the if statement?
1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @mtdewrocks 

You can use a numeric parameter for the desired result.

1. Add parameter 

Ritaf1983_0-1701229649553.png

2. create a flag measure with the needed condition  (using the parameter measure that you will have after creating the parameter):

color flag = if('Parameter'[Parameter Value]=[count_companies],1,0)
Ritaf1983_1-1701229782684.png

3. use conditional formatting based on the flag measure

Ritaf1983_2-1701229867492.png

Result :

Ritaf1983_3-1701229890479.png

Pbix is attached

If this post helps, then please consider Accepting it as the solution to help the other

members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

4 REPLIES 4
mtdewrocks
Regular Visitor

Your response is essentially what I tried. However, I am working with a column chart, and it still seems to be aggregating my column so all values are returning true, even when not. Sorry for being so new to the community, but can you assist with how to attach my pbix file? If so, I'm sure that would help troubleshoot.

Yes, without pbix it is very difficult to guess what you are trying to do and where the problem is.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

How do I upload my pbix file to you? I don't see the button or know how.

 

Ritaf1983
Super User
Super User

Hi @mtdewrocks 

You can use a numeric parameter for the desired result.

1. Add parameter 

Ritaf1983_0-1701229649553.png

2. create a flag measure with the needed condition  (using the parameter measure that you will have after creating the parameter):

color flag = if('Parameter'[Parameter Value]=[count_companies],1,0)
Ritaf1983_1-1701229782684.png

3. use conditional formatting based on the flag measure

Ritaf1983_2-1701229867492.png

Result :

Ritaf1983_3-1701229890479.png

Pbix is attached

If this post helps, then please consider Accepting it as the solution to help the other

members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.