Forum Discussion
Slicer for certain values
- Anonymous2 years ago
Hi MurtoMan ,
The Table data is shown below:
Please follow these steps:
1. Use the following DAX expression to create a TableTable 2 = GENERATESERIES(1,100,1)2.Use the following DAX expression to create a measure
Result = VAR _a = SELECTEDVALUE('Table'[Item]) VAR _b = SELECTEDVALUE('Table'[Factor]) VAR _c = SELECTEDVALUE('Table'[Value]) RETURN IF( _a = "Shoes", DIVIDE(_b,100) * MAX('Table 2'[Value]) * _c , _b * _c )3.Use the following DAX expression to create a measure
_Factor = IF( SELECTEDVALUE('Table'[Item]) = "Shoes", DIVIDE(SELECTEDVALUE('Table'[Factor]),100) * MAX('Table 2'[Value]),SELECTEDVALUE('Table'[Factor]))4.Final output
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi MurtoMan ,
Regarding your question, this is my thought process.
The Table data is shown below:
Please follow these steps:
1.Add an index column to determine which values to modify with the slicer.
2.Use the following DAX expression to create a table
Table 2 = GENERATESERIES(0.00,1.01,0.01)
3.Use the following DAX expression to create a measure(Assuming that the index columns corresponding to the specific values to be modified are 1, 2, 3)
MEASURE =
VAR _a =
MAX ( 'Table 2'[Value] )
VAR _b =
IF (
_a = CALCULATE ( MAX ( 'Table 2'[Value] ), ALL ( 'Table 2' ) ),
SUM ( 'Table'[Value A] ) * SUM ( 'Table'[Value B] ),
IF (
SELECTEDVALUE ( 'Table'[Index] ) IN { 1, 2, 3 },
_a
* SUMX (
FILTER ( 'Table', 'Table'[Index] = SELECTEDVALUE ( 'Table'[Index] ) ),
'Table'[Value B]
),
SUM ( 'Table'[Value A] ) * SUM ( 'Table'[Value B] )
)
)
RETURN
_b
3.Final output
Displays the default value when the slicer has not made a selection.
After selecting the slicer
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.