Forum Discussion

sg1234's avatar
sg1234
Icon for Helper I rankHelper I
1 year ago
Solved

Using more than one what if parameter and aligning each one to a specific user selected value

Hello, Thanks in advance for any help.  I am trying to work out a system whereby a user can look up the ingredients and work out the volume of ingredients they require to make a widget.  My proble...
  • sg1234's avatar
    sg1234
    1 year ago

    Hi Jarvis, 


    Many thanks for all your help with this. 

     

    Unfortunately, the main problem is how to have the results in one table, but after some more messing around, I've hit upon a solution that seems to work for our set up. So I have created three copies of our Table 2 but only containing a list of all of the possible widgets.  There are no relationships between the 3 new tables and any other tables.  I've then created 3 slicers, one for each of the tables, and the user can select a single widget from each slicer.  Then I use the following measures to grab the id of the selected widgets and to filter the main Table 1 so it only includes the selected widgets.

    So 3 versions of each of the two measures below:
    W_NUM_SELECTION_1 = IF(ISFILTERED(WIDGET_SELECTION_1),CALCULATE(MAX(WIDGET _SELECTION_1[WIDGET])),"")

     

    IngredientVolume1 =

    SUMX (

        FILTER('TABLE 1', 'TABLE 1'[WIDGET] = [W_NUM_SELECTION_1]),

     'TABLE 1'[PERCENT]  * SELECTEDVALUE('Volume Required'[Volume Required]) / 100

    )

    Then

    Ingredients_All = [IngredientVolume1]+[IngredientVolume2]+[IngredientVolume3]

     

    And the following measure to make sure that only the selected rows and included in the table

    ID_3_Mix = IF(

        AND(ISFILTERED(WIDGET_SELECTION_1[WIDGET]),

                     MAX(TABLE1[WIDGET]) = [W_NUM_SELECTION_1] ||

                     MAX(TABLE1[WIDGET]) = [W_NUM_SELECTION_2] ||

                     MAX(TABLE1[WIDGET]) = [W_NUM_SELECTION_3]), 1,0)

     

    Hope that helps someone. Or my future self when I forget how I did it previously! 

    Thanks again Jarvis for all your help!