Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I have a table summarising the value of opportunities secured by a sales team per quarter, the columns are as follows:
Quarter: A DateGlobalFilter table with a [Quarter] variable.
SumActualValue: A measure of won opportunity values.
Role Goal (Quarterly): A measure with HASONEVALUE and SWITCH, where if all team selected (slicer), £15m/quarter, and if a person's selected its changed to individual goals.
I am looking to have conditional formatting within the SumActualValue column so that the background colour spans from red to green depending on how close they are to the goal, but I am struggling with the DAX as I need the colouring to change dependant on the goal if changed.
(E.g. Q3 From my picture - Would be an orange colour [as about 30% of goal of £15m], but if I select a person with a quarterly goal of £2m and they secured £2.5m, I need this to change to green. So not comparing to the team goal of £15m.)
Here is my attempt at DAX which hopefully VAR only needs changing (can change colour descriptions to numbers and do rules in cond. formatting):
SecuredOpportunityValueColour =
VAR
QOppValue = // not sure for this. Variable for team selection/names is 'TeamUsers'[PersonName].
RETURN
IF(
HASONEVALUE(TeamUsers[PersonName]),
SWITCH(
TRUE(),
QOppValue < ([Role Goal (Quarterly)])/4, "Red",
(AND(QOppValue < ([Role Goal (Quarterly)])/2, QOppValue >= ([Role Goal (Quarterly)])/4)), "Orange",
(AND(QOppValue < ([Role Goal (Quarterly)])/(4/3), QOppValue >= ([Role Goal (Quarterly)])/2)), "Yellow",
QOppValue >= ([Role Goal (Quarterly)])/(4/3), "Green"),
"Grey")
Thank you.
Solved! Go to Solution.
Hi , @BotBot1
According to your description, you want to get the [QOppValue ] value.
And the [QOppValue ] value seems to get from the [Role Goal (Quarterly)]?
If this , you just need to make the [Role Goal (Quarterly)] return right in your logic in the visual .
And then you can use the [Role Goal (Quarterly)] in your 'QOppValue' parameter.
var QOppValue= [Role Goal (Quarterly)]
If i got missing in your need , can you provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , @BotBot1
According to your description, you want to get the [QOppValue ] value.
And the [QOppValue ] value seems to get from the [Role Goal (Quarterly)]?
If this , you just need to make the [Role Goal (Quarterly)] return right in your logic in the visual .
And then you can use the [Role Goal (Quarterly)] in your 'QOppValue' parameter.
var QOppValue= [Role Goal (Quarterly)]
If i got missing in your need , can you provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @v-yueyunzh-msft,
Thank you for this.
I managed to create a seperate measure creating a percentage of opportunity value to individual quarterly goals and did conditional formatting rules based off this measure. Thanks for your help.
Kind regards,
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
10 |