Forum Discussion

abrother's avatar
abrother
Frequent Visitor
1 year ago
Solved

Create a new table that categorizes values in a column based on columns and rows in another table

Hi everyone, thank you in advance for the help, this community has been great with input and fast replies.

 

What I'm trying to do is create a new table that takes values from a few columns (and rows) from another table and creates a categorization against production orders (lots basically). The intent is to create a table that shows, for each production order, what the revenue is based on the quantity of serial numbers of that SKU in that particular revenue category where each SKU has an already assigned revenue category, but multiple SKUs come out of each production order; each revenue category has a baseline budget revenue that we expect from the whole production order which is currently listed on each row. Sample data is below, let me know if you have any questions:

 

Here's what I have:

Production OrderSKUSKU ASPSerial NumberRevenue CategoryBudget Category Revenue per SKU
A123$75111CAT1$1,000
A123$75112CAT1$1,000
A123$75113CAT1$1,000
A123$75114CAT1$1,000
A123$75115CAT1$1,000
A456$100222CAT2$800
A456$100223CAT2$800
A456$100224CAT2$800
A456$100225CAT2$800
A456$100226CAT2$800
B123$75111CAT1$1,000
B123$75112CAT1$1,000
B123$75113CAT1$1,000
B123$75114CAT1$1,000
B123$75115CAT1$1,000
B789$110222CAT3$1,100
B789$110223CAT3$1,100
B789$110224CAT3$1,100
B789$110225CAT3$1,100
B789$110226CAT3$1,100

 

Here's what I want:

Production OrderRevenue CategoryBudget Category RevenueTotal Actual Category Revenue
ACAT1$1,000$375
ACAT2$800$500
BCAT1$1,000$375
BCAT3$1,100$550
  • Try this

     

    SummaryTable =
    SUMMARIZE(
    ProductionOrders,
    ProductionOrders[Production Order],
    ProductionOrders[Revenue Category],
    "Budget Category Revenue", MAX(ProductionOrders[Budget Category Revenue per SKU]),
    "Total Actual Category Revenue", SUM(ProductionOrders[SKU ASP])
    )

2 Replies

  • Try this

     

    SummaryTable =
    SUMMARIZE(
    ProductionOrders,
    ProductionOrders[Production Order],
    ProductionOrders[Revenue Category],
    "Budget Category Revenue", MAX(ProductionOrders[Budget Category Revenue per SKU]),
    "Total Actual Category Revenue", SUM(ProductionOrders[SKU ASP])
    )

    • abrother's avatar
      abrother
      Frequent Visitor

      Thanks very much for the quick reply niledra. That did it!