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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

Column Filtering within Summarize

Good day I am working with a table created called OTIF Table to calculate fulfillments in complete deliveries and on time of purchase orders, I have created the OTIF Table with summarize where it brings me the PONumber Number, QuantityOrdered, QuantityReceived, DateReceived, EstShipDate but within this table I want to include a filter for the QuantityReceived column where I add the items received, only if the date of receipt of such items is less than the DateReceived date.

Annex table creation formula

OTIF Table = SUMMARIZE(PurchaseOrderDetail,PurchaseOrderDetail[PONumber],
"Qty Order",sum(PurchaseOrderDetail[QuantityOrdered]),
"Qty Received",sum(PurchaseOrderDetail[QuantityReceived]),
"Date Received",Max(PurchaseOrderDetail[DateReceived].[ Date]),
"ETA",Max(PurchaseOrder[EstShipDate].[ Date]))

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

You can update the formula of calculated table as below, please find the details in the attachment.

OTIF Table = 
SUMMARIZE (
    FILTER (
        'PurchaseOrderDetail',
        'PurchaseOrderDetail'[DateReceived]
            <= CALCULATE (
                MAX ( 'PurchaseOrder'[EstShipDate] ),
                FILTER (
                    'PurchaseOrder',
                    'PurchaseOrder'[PONumber] = EARLIER ( 'PurchaseOrderDetail'[PONumber] )
                )
            )
    ),
    PurchaseOrderDetail[PONumber],
    "Qty Order", SUM ( PurchaseOrderDetail[QuantityOrdered] ),
    "Qty Received", SUM ( PurchaseOrderDetail[QuantityReceived] ),
    "Date Received", MAX ( PurchaseOrderDetail[DateReceived] ),
    "ETA", MAX ( PurchaseOrder[EstShipDate] )
)

PurchaseOrderDetail and PurchaseOrder tablePurchaseOrderDetail and PurchaseOrder table

Summarize table OTIF TableSummarize table OTIF Table

Best Regards

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Syndicate_Admin , Try like

 

Change it like

"Qty Received",calculate(sum(PurchaseOrderDetail[QuantityReceived]),filter(PurchaseOrderDetail,PurchaseOrderDetail[DateReceived]<PurchaseOrder[EstShipDate]))

 

 

or after summarize

filter(

SUMMARIZE(PurchaseOrderDetail,PurchaseOrderDetail[PONumber],
"Qty Order",sum(PurchaseOrderDetail[QuantityOrdered]),
"Qty Received",sum(PurchaseOrderDetail[QuantityReceived]),
"Date Received",Max(PurchaseOrderDetail[DateReceived].[ Date]),
"ETA",Max(PurchaseOrder[EstShipDate].[ Date])), [Date Received]<[ETA] )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Syndicate Admin

I do not find the proposal when performing the filter after annotating the table PurchaseOrderDetail does not let me put the condition <= PurchaseOrder EStShipDate

Anonymous
Not applicable

Hi @Anonymous ,

You can update the formula of calculated table as below, please find the details in the attachment.

OTIF Table = 
SUMMARIZE (
    FILTER (
        'PurchaseOrderDetail',
        'PurchaseOrderDetail'[DateReceived]
            <= CALCULATE (
                MAX ( 'PurchaseOrder'[EstShipDate] ),
                FILTER (
                    'PurchaseOrder',
                    'PurchaseOrder'[PONumber] = EARLIER ( 'PurchaseOrderDetail'[PONumber] )
                )
            )
    ),
    PurchaseOrderDetail[PONumber],
    "Qty Order", SUM ( PurchaseOrderDetail[QuantityOrdered] ),
    "Qty Received", SUM ( PurchaseOrderDetail[QuantityReceived] ),
    "Date Received", MAX ( PurchaseOrderDetail[DateReceived] ),
    "ETA", MAX ( PurchaseOrder[EstShipDate] )
)

PurchaseOrderDetail and PurchaseOrder tablePurchaseOrderDetail and PurchaseOrder table

Summarize table OTIF TableSummarize table OTIF Table

Best Regards

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors