Forum Discussion

stefano86's avatar
stefano86
New Member
1 year ago
Solved

Excel Power Query - how to make my tables work?

Good day everyone, this is my first post, and I thank you in advance for the time you will dedicate to help me understand my issue. I have the need to compare inventories from 2 different systems c...
  • pmreis's avatar
    1 year ago

    Hi stefano86 

     

    Add a table with the Unique products. You can make it preferably in Power Query, but for the simplicity and to make it easier to test here it is in DAX:

     

    Unique_SKU_Table = 
    DISTINCT(
        UNION(
            SELECTCOLUMNS(
                SeaCare_FULL_Inventory,
                "Unique SKU", [Unique SKU],
                "Vessel", [VESSEL],
                "Product Name", [NAME],
                "Category", [CATEGORY]
            ),
            SELECTCOLUMNS(
                CT_FULL_Inventory,
                "Unique SKU", [Unique SKU],
                "Vessel", [Vessel],
                "Product Name", [Product Name],
                "Category", [CATEGORY]
            )
        )
    )

     

     

    Then create metrics on this new table, to calculate the quantity on each related table.

     

    Total_SeaCare_Quantity =
    CALCULATE(
    SUM(SeaCare_FULL_Inventory[QUANTITY]),
    RELATEDTABLE(Unique_SKU_Table)
    )

     

    Total_CrunchTime_Quantity =
    CALCULATE(
    SUM(CT_FULL_Inventory[Total Quantity]),
    RELATEDTABLE(Unique_SKU_Table)
    )

    Pedro Reis - Data Platform MVP / MCT
    Making Power BI and Fabric Simple

    If my response resolved your issue, please mark it as a solution to help others find it. If you found it helpful, please consider giving it a kudos. Your feedback is highly appreciated!

    Find me at LinkedIn