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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

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
Community Champion
Community Champion

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
Community Champion
Community Champion

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.