Forum Discussion

ujwalynit's avatar
ujwalynit
Frequent Visitor
7 years ago
Solved

How to a expand one row to multiple rows ?

Hi ,   Need help with Dax command . I have two tables - Sales and Recipes  e.g. Sales SALES_DATE | POS_ITEM_ID |  POS_ITEM_NAME | SALES_UNITS 8/9/2019 | 13123213| Negroni | 10 7/9/2019 | 13123...
  • SeanMcLarty's avatar
    7 years ago

    Use GENERATEALL to join the tables by POS_ITEM_ID

    Sales and Recipies = GENERATEALL(
        Sales,
        SUMMARIZE(
            FILTER(
                Recipe,
                Recipe[POS_ITEM_ID] = Sales[POS_ITEM_ID]
            ),
            Recipe[INGREDIENT_ID],
            Recipe[INGREDIENT_NAME],
            Recipe[INGREDIENT_UNITS]
        )
    )