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 Wenbin,
This looks reasonable, but can you explain what is the purpose of this table?
Are these 3 values enough?
- Anonymous2 years agoNot applicable
Hi MurtoMan , Syndicate_Admin ,
Regarding your question, this expression creates a table of consecutive values.(Starting at 0 and ending at 1.01, each increase is 0.01, i.e., 1 percent.)
GENERATESERIES function - DAX | Microsoft Learn
This allows you to select the corresponding value via the slicer.
- MurtoMan2 years ago
Helper I
Hi, Anonymous
Ok I see.
But what comes to Index there is a problem.
Values A or B are not unique. So there would be different index values for same values A or B.
- Anonymous2 years agoNot applicable
Hi MurtoMan ,
What are your expected outcomes? Is it to change all the 0.35 in column 'Value A' to the selection in the slicer?
The expression I provided should be able to find the value in the corresponding column 'Value B' based on the index column
I modified the table data.
1.With no slicer selected(0.35 = 0.35 *1 0.7 = 0.35 *2 0.7 = 0.35 * 2 ........)
2.After selecting the slicer(0.96 = 0.96 * 1 1.92 = 0.96 *2 1.92 = 0.96 * 2 ......)