Forum Discussion

Emmy88_'s avatar
Emmy88_
Advocate I
2 years ago
Solved

Create groups based on similar values

Hi all,

 

I am trying to create groups of products based on order recipe values. Underneath an example of the data.

 

Each order can have different amounts of ingredients. I would like to make groups of the orders with similar amounts of ingredients. So if for order 1 ingredient a, ingredient b and ingredient c all are maximum 2% off e.g order 2, they should be in the same group. 

 

Does anyone know what dax to use here?

 

Greetings,

 

Emmy

 

  • Hi Emmy88_ - I have created a new table, based on the above input,

     

     

    OrderTotals =
    SUMMARIZE(
        'Ingred',
        'Ingred'[Order],
        "A", SUMX(FILTER('Ingred', 'Ingred'[Ingredients] = "a"), 'Ingred'[Amount]),
        "B", SUMX(FILTER('Ingred', 'Ingred'[Ingredients] = "b"), 'Ingred'[Amount]),
        "C", SUMX(FILTER('Ingred', 'Ingred'[Ingredients] = "c"), 'Ingred'[Amount])
    )
    output using table chart:

     

     

    Hope it works. Please check 

     

2 Replies

  • Hi Emmy88_ - I have created a new table, based on the above input,

     

     

    OrderTotals =
    SUMMARIZE(
        'Ingred',
        'Ingred'[Order],
        "A", SUMX(FILTER('Ingred', 'Ingred'[Ingredients] = "a"), 'Ingred'[Amount]),
        "B", SUMX(FILTER('Ingred', 'Ingred'[Ingredients] = "b"), 'Ingred'[Amount]),
        "C", SUMX(FILTER('Ingred', 'Ingred'[Ingredients] = "c"), 'Ingred'[Amount])
    )
    output using table chart:

     

     

    Hope it works. Please check 

     

    • Emmy88_'s avatar
      Emmy88_
      Advocate I

      Thank you, however how do you incoporate a deviation of e.g. 2 or 5% and cluser all those rows to for example group a, b or c?