Forum Discussion
RafalMonka
Helper I
4 years agoLine chart with Legend and additional measure
Hi, we have a dashboard with standard Line chart where Axis are months, Legend is UserAssigned and Values – some measure Score. What we need to do is to place additional measure which w...
- 4 years ago
RafalMonka
Helper I
4 years agoHi,
we have worked on Alexis's example, by adding visual filter Table1[User] and column Table1[Project].
When filtering by Project everything works very well.
However, when you try to select users on visual filter Table1[User], the changes are not reflected on Legend[User].
As you can see - user "Zbi" is deselected in visual filter but it still appears in Legend.
Modification of model is not possible.
Is it possible to modify code in order to include in chart Legend only items selected on visual filter Table1[User]?
AlexisOlson
Super User
4 years agoTry using KEEPFILTERS.
ChartValue =
IF (
SELECTEDVALUE ( Legend[User] ) = "Average",
AVERAGEX ( VALUES ( Table1[User] ), CALCULATE ( SUM ( Table1[Value] ) ) ),
CALCULATE (
SUM ( Table1[Value] ),
KEEPFILTERS ( TREATAS ( VALUES ( Legend[User] ), Table1[User] ) )
)
)