Forum Discussion
Min/Max Marker in Linechart
- Anonymous2 years ago
Hi Anonymous
For the first question, you can refer change your measure to the following, and my date hierarchy is year-week-date
MEASURE = VAR _maxdata = IF ( ISINSCOPE ( dimDate[Date] ), MAXX ( ALLSELECTED ( dimDate[Date] ), [Customer order] ), IF ( ISINSCOPE ( dimDate[Week] ), MAXX ( ALLSELECTED ( dimDate[Week] ), [Customer order] ), MAXX ( ALLSELECTED ( dimDate[Year] ), [Customer order] ) ) ) VAR _mindata = IF ( ISINSCOPE ( dimDate[Date] ), MINX ( ALLSELECTED ( dimDate[Date] ), [Customer order] ), IF ( ISINSCOPE ( dimDate[Week] ), MINX ( ALLSELECTED ( dimDate[Week] ), [Customer order] ), MINX ( ALLSELECTED ( dimDate[Year] ), [Customer order] ) ) ) RETURN SWITCH ( TRUE (), [Customer order] = _maxdata, "green", [Customer order] = _mindata, "red", "black" )Output (I set the data label color)
date level
week level
Year level
For the second question, becasue you have two measures in the y-axis, so it has the label, you can not set the chart color by conditionfal formatting, you can only change the chart color manually, so it is better that set the data label color, it can use the conditionfal formatting.
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
Please try the following.
MinMaxCustomerorder =
Var Customerorder = [Customer order]
VAR MaxCustomerorder =
IF (
ISINSCOPE(dimDate[Datum]),
MAXX(ALLSELECTED(dimDate[Datum]), [Customer order]),
IF (
ISINSCOPE(dimDate[KW]),
MAXX(ALLSELECTED(dimDate[KW]), [Customer order]),
IF (
ISINSCOPE(dimDate[Monat]),
MAXX(ALLSELECTED(dimDate[Monat]), [Customer order]),
MAXX(ALLSELECTED(dimDate[Jahr]), [Customer order])
)
)
)
VAR MinCustomerorder =
IF (
ISINSCOPE(dimDate[Datum]),
MINX(ALLSELECTED(dimDate[Datum]), [Customer order]),
IF (
ISINSCOPE(dimDate[KW]),
MINX(ALLSELECTED(dimDate[KW]), [Customer order]),
IF (
ISINSCOPE(dimDate[Monat]),
MINX(ALLSELECTED(dimDate[Monat]), [Customer order]),
MINX(ALLSELECTED(dimDate[Jahr]), [Customer order])
)
)
)
Var result =
SWITCH(
TRUE(),
Customerorder = MaxCustomerorder, "Red",
Customerorder = MinCustomerorder, "rgba(0, 0, 0, 0)",
"rgba(0, 0, 0, 0)"
)
RETURN result
The measure can work well in my sample
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
Still doesnt work, but I think I found where the problem was and hopefully fixed it.
Because I have a MonthNo column to sort my months corretly I have to add dimDate[MonthNo] also in the allselected statement.
MinMaxCustomerorder =
Var Customerorder = [Customer order]
VAR MaxCustomerorder =
IF (
ISINSCOPE(dimDate[Datum]),
MAXX(ALLSELECTED(dimDate[Datum]), [Customer order]),
IF (
ISINSCOPE(dimDate[KW]),
MAXX(ALLSELECTED(dimDate[KW]), [Customer order]),
IF (
ISINSCOPE(dimDate[Monat]),
MAXX(ALLSELECTED(dimDate[Monat],dimDate[MonthNo]), [Customer order]),
MAXX(ALLSELECTED(dimDate[Jahr]), [Customer order])
)
)
)
VAR MinCustomerorder =
IF (
ISINSCOPE(dimDate[Datum]),
MINX(ALLSELECTED(dimDate[Datum]), [Customer order]),
IF (
ISINSCOPE(dimDate[KW]),
MINX(ALLSELECTED(dimDate[KW]), [Customer order]),
IF (
ISINSCOPE(dimDate[Monat]),
MINX(ALLSELECTED(dimDate[Monat],dimDate[MonthNo])), [Customer order]),
MINX(ALLSELECTED(dimDate[Jahr]), [Customer order])
)
)
)
Var result =
SWITCH(
TRUE(),
Customerorder = MaxCustomerorder, "Red",
Customerorder = MinCustomerorder, "rgba(0, 0, 0, 0)",
"rgba(0, 0, 0, 0)"
)
RETURN resultand with that it shows everything I wished for 🙂
Thank you for your quick and detailed help.
I wish you a nice monday and a good week!