Forum Discussion
Comparing line chart
Hi jeseng ,
According to your description, I create this data:
Main Table:
Slice Table:
Here are the steps you can follow:
1. Create calculated column.
Year = YEAR('Table'[date])2. Create measure.
A =
var _1=
CALCULATE(SUM('Table'[people]),FILTER('Table',[region]="A"))
return
IF("A" in SELECTCOLUMNS('Slicer',"1",[Region]),_1,BLANK())B =
var _1=
CALCULATE(SUM('Table'[people]),FILTER('Table',[region]="B"))
return
IF("B" in SELECTCOLUMNS('Slicer',"1",[Region]),_1,BLANK())3. Place Year in Axis, measure A and measure B in Values, and place Region and Sex in different slicers
4. Result.
When we select Region A, only the data of A will be displayed in the line chart, and it will change with the selection of the slicer Sex
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much for taking your time with this!! But I seem to be explaining poorly 😉
I live in Gothenburg, we have 36 sub areas. I want a line chart where I can ALWAYS see the development for Gothenburg and then from a slicer choose ONE sub area. So that I always show 2 line, one that is locked (Gothenburg) and one that the user chooses.
There will also be a slicer for Age and Gender but that doesn't seem to be the main problem.
I CAN solve this in my datatable by creating a new column with the values for Gothenburg and put this on every row, so that every sub area have two values, but this will be difficult to update since I plan to collect the data via API....
Best Regards,
Jessica