Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
Employee

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
Employee
Employee

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.
Anonymous
Not applicable

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.