Forum Discussion

MurtoMan's avatar
MurtoMan
Helper I
2 years ago
Solved

Slicer for certain values

I have a visualization that shows a comparison of certain values.  There is a simple calculation like Value A * Value B = Result (in bars) I want a slicer like this that changes only few cert...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi MurtoMan ,

    The Table data is shown below:

    Please follow these steps:
    1. Use the following DAX expression to create a Table

     

    Table 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.