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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
FVP
Helper I
Helper I

Create a slicer for a fictive price point

Hi all,

Hope you can help me find a solution for the following:


Background:

I have a dataset that looks like the table below. I match the price of my article with the prices of my competitors.

I can then see the impact ($ difference) with the number of sales and the difference between my and my competitors pricing.

 

ArticleMy priceCompetitorCompetitor PriceDifferenceSold items$ difference
Bread$1,00Supermarket 1$1,100,10252,50
Bread$1,00Supermarket 2$1,000250
Bread$1,00Supermarket 3$0,80-0,2025-5,00

 

The total diffence for Bread is -$2,50 (2,50 + 0 + -5,00) at my current price point of $1,00.

 

Question: 

I want to make a slider that makes a fictive price for the column 'My Price' to see how this would change my $ difference.

So for example, if I make my price of bread to $0,95, how much would be $ difference be? 

 

Is there a way of making a fictive variable that I can put in a slicer?



Hope someone has a helpful tip for this 🙂 Thanks in advance!

2 ACCEPTED SOLUTIONS
johnt75
Super User
Super User

You can create a numeric range parameter. That will add a slicer to the page and create a measure to return the selected value, so your measure for difference would be something like

Difference =
SUMX (
    'Table',
    ( 'Table'[Competitor price] - [My price value] ) * 'Table'[num sold]
)

View solution in original post

In your difference measure where you would have referenced the difference column from the table you now reference the parameter value, as in the code sample I posted. Then when you put the difference measure in a visual it will change as you change the slicer.

View solution in original post

4 REPLIES 4
johnt75
Super User
Super User

You can create a numeric range parameter. That will add a slicer to the page and create a measure to return the selected value, so your measure for difference would be something like

Difference =
SUMX (
    'Table',
    ( 'Table'[Competitor price] - [My price value] ) * 'Table'[num sold]
)

Hi Johnt75,

 

Thanks for your reply!

I am not sure I understand.
So when I've made the parameter as described above, and changed the measure into the calculation, it shows up like this:

 difference measure parameter.png

 

I've added the parameter as a slicer, but it doesnt do anything yet (as I've probably missed something crucial).
How does the parameter change the outcome of the data exactly?

Sorry if this is confusing, parameters are very new to me

In your difference measure where you would have referenced the difference column from the table you now reference the parameter value, as in the code sample I posted. Then when you put the difference measure in a visual it will change as you change the slicer.

Hi @johnt75, Sorry for my late reply. Your solution works!

 

There is something in my original dash (model/file source related) that doesnt work with the solution, so hence I was so puzzled. But on a different simplified dash, it works great.

Thanks for the time and effort 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors