Using slicer value in a DAX calculation

btreg

New Member
Joined
Feb 29, 2016
Messages
30
Thanks to help from an earlier thread, I am using the following measure in my model:

MINX (
TOPN ( 2 , VALUES (Basic_Level_Mode_Fees[Provider short name]), CALCULATE ( [Sum_FTE] ) ),
CALCULATE ( [Sum_FTE] )
)

I want the report user to be able to control the number 2 by selecting from the numbers 1 to 10 in a slicer.

I have created a disconnected table called 'Rank' containing the values 1 to 10 and created a slicer from this table. I've then amended the formula as follows:

MINX (
TOPN ( VALUES (Rank[Rank]) , VALUES (Basic_Level_Mode_Fees[Provider short name]), CALCULATE ( [Sum_FTE] ) ),
CALCULATE ( [Sum_FTE] )
)

However, this returns the error message "A table of multiple values was supplied where a single value was expected" even when a single value (e.g. "3") is selected with the slicer. I thought that selecting "3" with the slicer would filter the 'Rank' table to a single value (3)?

Can anyone advise what I doing wrong?

Also, are there any alternative methods to gathering the input of a number from 1 to 10 from the user, other than using a slicer? Can a DAX formula refer to a cell in an Excel worksheet, controlled by a spin button, for example)?

Any help much appreciated.


 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,215,506
Messages
6,125,193
Members
449,213
Latest member
Kirbito

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top