Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Filter in Linechart

Hi everyone, I'm stuck on a seemingly simple problem. I have a linechart that i want to use filters on, my data looks like this (very simplified)

Screenshot 2024-11-13 103458.png

and the chart looks like this. Now i want to be able to filter by tax applied (Yes/No) and Discount Given (Yes/No), but cant make it work. How would you go about this?

Screenshot 2024-11-13 103417.png

 Many Thanks

1 ACCEPTED SOLUTION
shafiz_p
Super User
Super User

Hi @Anonymous  To acheive this , first you need to convert your data table to the below format. See image:

shafiz_p_0-1731492562942.png

 

Follow the below steps to achieve such transformation:

Import data table to below format:

shafiz_p_1-1731492661400.png

Select first column and transform table :

shafiz_p_2-1731492736744.png

Promoted as header first row.
Then select red marking column and unpivot other columns. See image:

shafiz_p_3-1731492820869.png

Now you will get your desired result.

shafiz_p_4-1731492849652.png

Close and load and define your desired visuals. See image:

shafiz_p_5-1731492912572.png

 

After applying filter:

shafiz_p_6-1731492954909.png

 

 

 

Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

 

Best Regards,
Shahariar Hafiz

View solution in original post

4 REPLIES 4
shafiz_p
Super User
Super User

Hi @Anonymous  To acheive this , first you need to convert your data table to the below format. See image:

shafiz_p_0-1731492562942.png

 

Follow the below steps to achieve such transformation:

Import data table to below format:

shafiz_p_1-1731492661400.png

Select first column and transform table :

shafiz_p_2-1731492736744.png

Promoted as header first row.
Then select red marking column and unpivot other columns. See image:

shafiz_p_3-1731492820869.png

Now you will get your desired result.

shafiz_p_4-1731492849652.png

Close and load and define your desired visuals. See image:

shafiz_p_5-1731492912572.png

 

After applying filter:

shafiz_p_6-1731492954909.png

 

 

 

Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

 

Best Regards,
Shahariar Hafiz

anmolmalviya05
Super User
Super User

Hi @Anonymous, 

Your data structure currently has "Tax applied" and "Discount given" as separate rows. To use them as filters, they need to be part of the same row for each day and product category. Restructure the data like this:

Day Product Value Tax Applied Discount Given

MondayApples10YesNo
MondayBananas4NoYes
MondayCarrots9YesNo
TuesdayApples12YesNo
TuesdayBananas7NoYes
TuesdayCarrots15YesNo
FridayApples9YesNo
FridayBananas15NoYes
FridayCarrots13YesNo


To achieve this, you can use pivot/unpivot option available in Power Query editor.

Once the data is in column format, you can use them in a slicer

Uzi2019
Super User
Super User

Hi @Anonymous 

Can you share the raw data screenshot???
it seems unclear to me..

go to table view and sahre the screenshot..

Uzi2019_0-1731491998842.png

 

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
vanessafvg
Super User
Super User

when you say you can't make it work, what do you  mean exactly.  have you put slicers on the page?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.