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
ephramz
Helper II
Helper II

Help with calculated column DAX function

Table 1:

Order Number         Material Description        Quantity         Calculated Column (Total Quantity)
11111111                      Panel                              3                                       17
11111111                      Panel                              3                                       17
11111111                      Panel                              3                                       17
11111111                      Panel                              3                                       17
11112222                     Window                          4                                         0
22222222                      Spacer                            3                                        3

I want to create a calculated column (Total Quantity) which calculates the number of Quantity based on the Order Number and only calculates the quantity when the material description is either Panel or Spacer. Returns 0 if not in this material description.

What is the DAX function for this . Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ephramz , Try a new column like

 

sumx(filter(Table, [Order Number] = earlier([Order Number]) && [Material Description] in {"Panel" , "Spacer"}),[Quantity] )

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@ephramz , Try a new column like

 

sumx(filter(Table, [Order Number] = earlier([Order Number]) && [Material Description] in {"Panel" , "Spacer"}),[Quantity] )

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.

Top Solution Authors