Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
On a line chart visual, "actual sales" and "target sales" are on Y-axis and "date" is on X-axis . On the secondary Y-axis, showing the "difference" (actual and target sales).
I have to highlight the highest "difference" ( with different colour/marker) on the chart.
Please help me out to achieve this.
Thanks
Solved! Go to Solution.
@jitpbi
First create a difference column between actual and target sales:
Diff=
VAR a = [actual sales]-[target sales]
Return
VALUE(RIGHT(a,LEN(a)- IFERROR(FIND("-",a),0)))
Then flag the highest difference with measure:
Measure = IF(SUM('Table'[Diff])=CALCULATE(MAX([Diff]),ALL('Table')),1,0)
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@jitpbi
First create a difference column between actual and target sales:
Diff=
VAR a = [actual sales]-[target sales]
Return
VALUE(RIGHT(a,LEN(a)- IFERROR(FIND("-",a),0)))
Then flag the highest difference with measure:
Measure = IF(SUM('Table'[Diff])=CALCULATE(MAX([Diff]),ALL('Table')),1,0)
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@jitpbi
Try like
FormatMeasure =
VAR MaxAmount = CALCULATE(MAXX(VALUES('Table'[Difference]),[Sales Amount]),ALL('Table'[Region]))
VAR LineAmonut = [Actual]
RETURN
SWITCH (
TRUE(),
LineAmonut = MaxAmount, "GREEN",
LineAmonut = MinAmount, "RED"
)
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@jitpbi , I doubt conditional format work with more than one measure.
You can create two-measure highest and lowest difference and plot them with a marker .
use the idea used in -https://community.powerbi.com/t5/Community-Blog/Display-Label-Only-on-the-Last-Data-Point-of-the-Lin...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |