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

SUMMARIZECOLUMNS - FILTER on all rows of each group

Hi guys.

I have a table and I want to count the rows of each group. The detail is that I want to filter by a specific column, not using a simple filter, but filtering so that all the rows in each group contain a specific value. This image is quite explanatory:

SUMMARIZE.png

 

 

 

 

 

 

 

I know the syntax of SUMMARIZECOLUMNS, I just don't know how can I do this without using a rather stupid and costly approach in terms of processing:

TEST = 
SUMMARIZECOLUMNS (
    service_kpi_parts_orders_importer[order_id],
    service_kpi_parts_orders_importer[part_number],
    service_kpi_parts_orders_importer[order_creation_year],
    service_kpi_parts_orders_importer[position],
    service_kpi_parts_orders_importer,
    "TYPES", CALCULATE ( DISTINCTCOUNT ( service_kpi_parts_orders_importer[delivery_type] ) ),
    "TYPES TO FILTER", CONCATENATEX(VALUES(service_kpi_parts_orders_importer[delivery_type]),service_kpi_parts_orders_importer[delivery_type],UNICHAR(10)
)
)

Here I was trying to create a table and test some possibilities, but no success so far.

Can you suggest something? Something leaner and less processing-expensive?

Thanks in advance.

Cheers!

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

I thought that the only one you wanted to take out was the F you should redo to this:

 

positions =
CALCULATE (
    COUNTROWS (
        FILTER (
            SUMMARIZE (
                ADDCOLUMNS (
                    service_kpi_parts_orders_importer;
                    "yeardatum"; service_kpi_parts_orders_importer[year]
                );
                service_kpi_parts_orders_importer[order_id];
                service_kpi_parts_orders_importer[part_number];
                [yeardatum];
                service_kpi_parts_orders_importer[position];
                "COUNT"; DISTINCTCOUNT ( service_kpi_parts_orders_importer[delivery_type] );
                "Type_Order"; CONCATENATEX (
                    ALLSELECTED ( service_kpi_parts_orders_importer[delivery_type] );
                    service_kpi_parts_orders_importer[delivery_type];
                    "."
                )
            );
            [COUNT] = 1
                && [Type_Order] = "S"
        )
    )
)

The bold part of the measure is the filter you should change to get the order type you want.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

11 REPLIES 11

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.