The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Dear Experts,
in delivery data, having A, B, C & D zones, and total order time measure.
need formate color of total of order tiime based on target which are different for each zone as bellow.
Targers of zones:
A <= 35 minutes
B<= 30 Mintues
C<= 55 mintues
D <= 40 mintues
if acheived put green, if not put red,
How do that in Power BI. I prefer to do example in power bi
Solved! Go to Solution.
Hi,@majid154a
I'm not sure if your data is in this form:
If it is, you can refer to this method to achieve your needs.
Create a Measure for labeling the total order time for each Zone:
Average total order time =
CALCULATE (
AVERAGE( 'Table02'[Order_time] ),
FILTER ( ALL ( Table02 ), 'Table02'[Zones] = MAX ( 'Table02'[Zones] ) )
)
Create another Measure to determine if the target value is reached:
Color_change =
SWITCH (
TRUE (),
SELECTEDVALUE ( Table02[Zones] ) = "A"
&& [Average total order time] <= 35, 1,
SELECTEDVALUE ( Table02[Zones] ) = "B"
&& [Average total order time] <= 30, 1,
SELECTEDVALUE ( Table02[Zones] ) = "C"
&& [Average total order time] <= 55, 1,
SELECTEDVALUE ( Table02[Zones] ) = "D"
&& [Average total order time] <= 40, 1,
0
)
Finally a background color rule is used to fill in the corresponding results:
Result :
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,@majid154a
I am glad to help you.
According to your description, you want to formatting color of measure?
If I understand you correctly, then you can refer to my solution.
First I simply created some data based on what you meant:
Then for the four zones A,B,C,D created the corresponding four Measures to calculate their Tatol order time:
Total order time of A = SUM('Table'[A])
Total order time of B = SUM('Table'[B])
Total order time of C = SUM('Table'[C])
Total order time of D = SUM('Table'[D])
Then you can directly go to 'Format you visual' to format color, as shown below:
Set your rules for formatting color of measure over here.
You can set the color rules for the different Measures directly from this side and then repeat the above steps.
The final result:
This is just a simple example, hope it helps you.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you very much for your cooperation, sacrifice, and detailed explanation, which reflects your high morals.
The solution you provided is correct, but I need to work on each area individually, and I have many areas.
The idea is that I want to work with the zones and the average order time in table chart, and the colors of the average order time should change according to the target for each aree
attached is an example and how we do like that:
Hi,@majid154a
I'm not sure if your data is in this form:
If it is, you can refer to this method to achieve your needs.
Create a Measure for labeling the total order time for each Zone:
Average total order time =
CALCULATE (
AVERAGE( 'Table02'[Order_time] ),
FILTER ( ALL ( Table02 ), 'Table02'[Zones] = MAX ( 'Table02'[Zones] ) )
)
Create another Measure to determine if the target value is reached:
Color_change =
SWITCH (
TRUE (),
SELECTEDVALUE ( Table02[Zones] ) = "A"
&& [Average total order time] <= 35, 1,
SELECTEDVALUE ( Table02[Zones] ) = "B"
&& [Average total order time] <= 30, 1,
SELECTEDVALUE ( Table02[Zones] ) = "C"
&& [Average total order time] <= 55, 1,
SELECTEDVALUE ( Table02[Zones] ) = "D"
&& [Average total order time] <= 40, 1,
0
)
Finally a background color rule is used to fill in the corresponding results:
Result :
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |