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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.