Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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,
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |