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
EashwarBalaji
Resolver I
Resolver I

Changing a parameter based on a slicer

Can I change a parameter based on the selected slicer value?
The parameter then is used to calculate a column displayed on the report in a table

1 ACCEPTED SOLUTION
HughLa
Resolver IV
Resolver IV

Hi @EashwarBalaji 

 

You will be able to create a numeric range parameter with which you can change the value with a slicer.

You can use that value within a measure or calculated column.

 

Here is an example:

HughLa_0-1676541925946.png

This table is automatically created (with one column and one measure):

This measure returns the selected value of the slicer which you will use in your formula.

HughLa_1-1676541936601.png

HughLa_2-1676542065772.png

 

Hope this helps you.

Hugh

 

View solution in original post

10 REPLIES 10
HughLa
Resolver IV
Resolver IV

Hi @EashwarBalaji 

 

You will be able to create a numeric range parameter with which you can change the value with a slicer.

You can use that value within a measure or calculated column.

 

Here is an example:

HughLa_0-1676541925946.png

This table is automatically created (with one column and one measure):

This measure returns the selected value of the slicer which you will use in your formula.

HughLa_1-1676541936601.png

HughLa_2-1676542065772.png

 

Hope this helps you.

Hugh

 

Hi @HughLa ,

 

I tried your above method and got the default value of the slicer sorted, but when i change th evalue of slicer, it does not change the SELECTEDVALUE part of the parameter. I have set the default value as 465000.

Drop Dead Miles Value = SELECTEDVALUE('Drop Dead Miles Cap'[Drop Dead Miles],465000)
 
Irrespective of the change of value in the slicer as shown below:

 

EashwarBalaji_0-1677752987850.png

The selected value still remains to be 465000:

EashwarBalaji_1-1677753161631.png


Why is it not changing to the current slicer value? Am i missing something?

 

Thanks!

Hi @EashwarBalaji 

 

That is strange that it is not changing. 

I just tested it on my side and it changes to the selected value in the slicer. Maybe try playing around with the default value.

 

Hugh

 

Ok I dont know how or why but, the parameter value is updating now.

 

But I'm using this value to calculate a measure (For a new column), this does not change though. Is there something I need to do? Refreshing after changing the slicer does not help either.

Hey @EashwarBalaji 

 

Are you using that measure in a Calculated column or a Measure? If you are using it in a calculated column it will have a static value and the slicers will not have any effect on the data.

 

Regards

Hugh

Currently using as a calculated column and yes its taking the static value (the default value)
Will it helpo if I use it as a measure and do the calculated column based on the measure?

 

What is it exactly that you are trying to achieve with the calculated column? Would you not be able to use a measure instead?

 

I cant really say the exact thing I'm calculating, but for simplecity sake, say the table has columns A, B (a numeric), C and so on.. 

 

I want the calculated column to be = Slicer Value - Column B

I would suggest using a measure here, because you are using a what if parameter which is meant to change, and a calculated column which is static won't work.

Thank you so much

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