March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi!
I need a line chart that only shows filtered data. User could use a filter and select the data they want to be seen in the line chart.
Here is my data (excel):
Here is the line chart:
Here is the filter - how should I build it?
Many thanks!
Tuomo, Finland
Solved! Go to Solution.
Hi @nTuomo ,
I suggest you to create a Dim column header table to help calculation.
Dim data column header =
DATATABLE(
"data column",STRING,
"Order",INTEGER,
{
{"data 1",1},
{"data 2",2},
{"data 3",3},
{"data 4",4},
{"data 5",5}
}
)
Measure:
Measure =
VAR _data1 = SUM('Table'[data 1])
VAR _data2 = SUM('Table'[data 2])
VAR _data3 = SUM('Table'[data 3])
VAR _data4 = SUM('Table'[data 4])
VAR _data5 = SUM('Table'[data 5])
RETURN
SWITCH(SELECTEDVALUE('Dim data column header'[Order]),1,_data1,2,_data2,3,_data3,4,_data4,5,_data5)
Result is as below.
Or you can Unpivot other columns by [year] in Power Query Editor to do some transformation on your table.
Then it will be easier to achieve your goal, you can add [Value] in Y axis and [Attribute] in Legend.
For reference: Unpivot columns - Power Query | Microsoft Learn
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@saipranay Thank you for the reply!
But how could I get the filter to work so that user can select, which data is visible on line chart?
Selection should be between Data 1 / Data 2 / Data 3 ... etc
Not the way it is now (2 / 8 / 9 etc...) :
Hi @nTuomo ,
I suggest you to create a Dim column header table to help calculation.
Dim data column header =
DATATABLE(
"data column",STRING,
"Order",INTEGER,
{
{"data 1",1},
{"data 2",2},
{"data 3",3},
{"data 4",4},
{"data 5",5}
}
)
Measure:
Measure =
VAR _data1 = SUM('Table'[data 1])
VAR _data2 = SUM('Table'[data 2])
VAR _data3 = SUM('Table'[data 3])
VAR _data4 = SUM('Table'[data 4])
VAR _data5 = SUM('Table'[data 5])
RETURN
SWITCH(SELECTEDVALUE('Dim data column header'[Order]),1,_data1,2,_data2,3,_data3,4,_data4,5,_data5)
Result is as below.
Or you can Unpivot other columns by [year] in Power Query Editor to do some transformation on your table.
Then it will be easier to achieve your goal, you can add [Value] in Y axis and [Attribute] in Legend.
For reference: Unpivot columns - Power Query | Microsoft Learn
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @nTuomo ,
As per your stated question, In Visualization tab we can use slicer visual to get the functionality you are looking for.
Use this as a visual for your report buliding.
By following above steps you can get our fliter option which you are looking for.
For addition help:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
86 | |
77 | |
57 | |
52 |
User | Count |
---|---|
201 | |
137 | |
108 | |
73 | |
68 |