Would like to ask for any related help with my issue
There is a measure Fullness:
Fullness =
SWITCH(
SELECTEDVALUE('Stock type'[Stocks type]),
"Stock Fact + Stock on the way", SUMX(
'Stock',
DIVIDE(
'Stock'[GroupWeight] * 'Stock'[Stock pcs] * 'Stock'[Capacity],
SUM('Cap'[Capacity])
)
) + SUM('Cap'[Capacity]) * 0,
"Stock Fact", SUMX(
'Stock',
DIVIDE(
'Stock'[GroupWeight] * 'Stock'[Stock fact] * 'Stock'[Capacity],
SUM('Cap'[Capacity])
)
) + SUM('Cap'[Capacity]) * 0
)
which calculates Fullness value in two scenarios based on selected value in slicer (table with just two options - "Stock Fact + Stock on the way" or "Stock Fact"). It is ok that values can be more than 100%.
There is a matrix with Stores as rows and Departments as columns Fullness measure output
There are many tables in my model, but main ones involved in current calculation are Tables relationships
The issue is to add value range slicer that able to filter only those Stores/Departments which meets slicer condition. For example, if we set slicer value to 0.4 (40%), matrix should show only those Stores/Dept-s Fullness values of those are less then 40%.
I added parameter as a slicer, implying that 1 is 100% and increment is 10%
Parameter = GENERATESERIES(0.1, 1, 0.1)
Value Parameter = SELECTEDVALUE('Parameter'[Parameter])
I have tried to handle it also with SELECTEDVALUE, but didnt get expected result so far..
Thank you in advance for your time!
If it is a range slicer then you won't get a result from SELECTEDVALUE
. SELECTEDVALUE
only returns a value if only one value is found.
You need to capture the min/max. Try something like:
var minSlice = MIN('Parameter'[Parameter])
var maxSlice = MAX('Parameter'[Parameter])
var result = [Fullness]
return IF(minSlice <= result && result <= maxSlice, result)