cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Dax rollup rows

I have two levels. Product line level and above that, work order level. There can be multiple products per work order. I calculate an attribute about the product, but then need to roll that up to the work order level based on a hierarchy.

 

For example, work order a has products 1,2,3. Product 1 = Install. Product 2=Delivery. Product 3=Connect. I need Install to show up for work order a. The order is Install then Connect then Delivery. If there is any Install in any of the products for a work order, it should show up as Install. If there is no Install but there is a Connect, then it should show up Connect. If neither of those, then Delivery.

 

Ex.

Current Output
Work OrderProductDIC Work OrderDIC
A1Delivery AInstall
A2Install BConnect
A3Delivery CDelivery
A4Connect   
B1Delivery   
B2Delivery   
B3Connect   
C1Delivery   
C2Delivery   
C3Delivery   
C4Delivery   
C5Delivery   
1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft
Microsoft

Hi @Anonymous,

 

You can create a calculated table using below formula:

Summarize Product table =
SUMMARIZE (
    Product_table,
    Product_table[Work Order],
    "DIC", IF (
        CALCULATE (
            COUNT ( Product_table[DIC] ),
            FILTER (
                ALLEXCEPT ( Product_table, Product_table[Work Order] ),
                Product_table[DIC] = "Install"
            )
        )
            >= 1,
        "Install",
        IF (
            CALCULATE (
                COUNT ( Product_table[DIC] ),
                FILTER (
                    ALLEXCEPT ( Product_table, Product_table[Work Order] ),
                    Product_table[DIC] = "Connect"
                )
            )
                >= 1,
            "Connect",
            "Delivery"
        )
    )
)

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Microsoft
Microsoft

Hi @Anonymous,

 

You can create a calculated table using below formula:

Summarize Product table =
SUMMARIZE (
    Product_table,
    Product_table[Work Order],
    "DIC", IF (
        CALCULATE (
            COUNT ( Product_table[DIC] ),
            FILTER (
                ALLEXCEPT ( Product_table, Product_table[Work Order] ),
                Product_table[DIC] = "Install"
            )
        )
            >= 1,
        "Install",
        IF (
            CALCULATE (
                COUNT ( Product_table[DIC] ),
                FILTER (
                    ALLEXCEPT ( Product_table, Product_table[Work Order] ),
                    Product_table[DIC] = "Connect"
                )
            )
                >= 1,
            "Connect",
            "Delivery"
        )
    )
)

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Output header should be farther to the right, above 2nd Work Order...

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors