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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
SKan
Frequent Visitor

How to user input from slicer to create new lines on a line chart showing the changes

Hello,

 

I would apprecite if anyone could  help me with this question.

In simple words, I have an excel sheet that i imported to power bi. There is one table"Product" that has two columns namely "Product Name" and "Price".

i have a report in power bi desktop with a line chart that shows the products on x axis and their current prices on y axis. Note that each row is a unique product with its retail price.

I want the end user to enter two vales as "minimum discount" and "maximum discount" using a slicer, and that results in two more lines on the chart depicting the discounted price.

 

-I have tried calculated column for min and max discounted price for each product by creating formula using the selected slicer value. The problem is that the price does not change when i change the slicer value, although it show the new slicer value every time i change it.

 

-I tried using parameters and measures but measures work on aggregates and i have unique products and prices.

 

Thank you.

 

 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @SKan ,

According to your description, here's my solution.

Sample:

vyanjiangmsft_0-1690966602881.png

1.Create two parameters.

vyanjiangmsft_1-1690966671489.png

vyanjiangmsft_2-1690966721712.png

Then two slicers are created, you can enter the discount in each slicer.

vyanjiangmsft_3-1690966780792.png

2.Creat two measures.

MaxD =
MAX ( 'Product'[Price] ) * 'Max Discount'[Max Discount Value]
MinD =
MAX ( 'Product'[Price] ) * 'Min Discount'[Parameter Value]

Put the measures in line chart Y-axis, get the result:

vyanjiangmsft_4-1690966906157.png

I attach my sample below for your reference.

 

Best regards,

Community Support Team_yanjiang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @SKan ,

According to your description, here's my solution.

Sample:

vyanjiangmsft_0-1690966602881.png

1.Create two parameters.

vyanjiangmsft_1-1690966671489.png

vyanjiangmsft_2-1690966721712.png

Then two slicers are created, you can enter the discount in each slicer.

vyanjiangmsft_3-1690966780792.png

2.Creat two measures.

MaxD =
MAX ( 'Product'[Price] ) * 'Max Discount'[Max Discount Value]
MinD =
MAX ( 'Product'[Price] ) * 'Min Discount'[Parameter Value]

Put the measures in line chart Y-axis, get the result:

vyanjiangmsft_4-1690966906157.png

I attach my sample below for your reference.

 

Best regards,

Community Support Team_yanjiang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ritaf1983
Super User
Super User

Hi @SKan 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.