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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

create table based on another table

Hi all, I currently have a table (Table 1) that I want to use to create Table 2. For Table 2, I would like only one row for each customer ID, a column indicating whether the customer has the string "premium plus" in any of its SKUs, and the Max Quantity for that customer. Please see the example tables below, I would like to know how to use the summarize function or other functions to create Table 2. Thanks!

 

Table 1

Customer IDSKUQuantity
1Premium Plus X5
1Regular2
2Regular2
2Regular2
3Premium Plus Y5
3Regular4

 

Table 2

Customer IDHas text "Premium Plus" in any SKU?Max (Quantity)
1Yes5
2No2
3Yes5
1 ACCEPTED SOLUTION
MikeJohnsonZA
Responsive Resident
Responsive Resident

Hi

 

To create a table ased on a single row per unique value we can use the SUMMARIZECOLUMNS funtion, we then nee to calculate the two values, this is faiully striagforward for the second on as it is simply the Maximum value for each row. The 'premium plus' is a little harder but can be done using the SEARCH function to finter for SKU's with the condition then counting such rows then converting those into YES or No. The below formula shoudl work for you to create the table you are looking for. 

 

Table2 =
SUMMARIZECOLUMNS (
    'Table1'[Customer ID],
    "Has text 'Premium Plus' in any SKU?",
        IF (
            COUNTROWS (
                FILTER ( 'Table1', SEARCH ( "Premium Plus", Table1[SKU], 1, 0 ) > 0 )
            ),
            "Yes",
            "No"
        ),
    "Max (Quantity)", MAX ( 'Table1'[Quantity] )
)

 

 

View solution in original post

1 REPLY 1
MikeJohnsonZA
Responsive Resident
Responsive Resident

Hi

 

To create a table ased on a single row per unique value we can use the SUMMARIZECOLUMNS funtion, we then nee to calculate the two values, this is faiully striagforward for the second on as it is simply the Maximum value for each row. The 'premium plus' is a little harder but can be done using the SEARCH function to finter for SKU's with the condition then counting such rows then converting those into YES or No. The below formula shoudl work for you to create the table you are looking for. 

 

Table2 =
SUMMARIZECOLUMNS (
    'Table1'[Customer ID],
    "Has text 'Premium Plus' in any SKU?",
        IF (
            COUNTROWS (
                FILTER ( 'Table1', SEARCH ( "Premium Plus", Table1[SKU], 1, 0 ) > 0 )
            ),
            "Yes",
            "No"
        ),
    "Max (Quantity)", MAX ( 'Table1'[Quantity] )
)

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.