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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Tejinder
Helper I
Helper I

PBI Summarize with Flter and IF function Help ?

Thanks for clicking on this

This is my sample data: 

BarcodeIDOrder IDBOX sequenceTotalBoxesReceived(Y/N)received
100620559195914Y2023-07-18 8:16
100620565195944Y2023-07-18 8:16
100620566195924Y2023-07-18 8:16
100620567195934Nnull
100673629196150644Y2023-07-21 9:01
100673630196150624Y2023-07-21 9:01
100673631196150634Y2023-07-21 9:01
100673632196150614Y2023-07-21 9:01
10068619919667Y2023-07-21 2:16
10068620019677Y2023-07-21 2:16
10068620119657Y2023-07-21 2:16
10068620319637Y2023-07-21 2:52
10068620419647Y2023-07-21 2:13
10068620519617Y2023-07-21 2:13
10068620619627Y2023-07-21 2:13
1006829641961600255Nnull
1006829651961600245Nnull
1006829661961600235Nnull
1006829671961600225Nnull
1006829681961600215Nnull


This is from an inventory scan; scans are done daily on barcode levels.
Every order has multiple boxes and unique barcodes for those boxes, sometimes some or all are not scanned (missing). I would like to summarize it into partially missing, missing, or complete,
For example:

1959 is partial
1961506 is complete
19616002 is missing


There are time stamps for every scan and sometimes some of the orders are scanned multiple times and new records are created, it doesn’t replace existing scans or lack of.

The way I tried to do it is by creating a table by summarizing DAX measure, but it doesn't work for me operationally because some orders are scanned multiple times, Let's take order 1959 for example. If it has 3/4 boxes scanned it will show as partial but if another box is scanned at a later date, it will count it as 4 scans and show it as complete.

I would like to have it in a measure so I can filter it by time/date

Here is my DAX:

Output =

VAR _1 =

SUMMARIZE(

'Table','Table'[Order ID],

"TotBox",Max( 'Table'[TotalBoxes] ),

"Count",

COUNTROWS(

FILTER(

'Table', 'Table'[Received(Y/N)] = "Y"

) )

)

VAR _2 =

ADDCOLUMNS(

_1,"Status",

IF(

[Count]= BLANK(),"Missing",

IF(

[Count] = [TotBox],"Completed",

"Partially Completed"

) ) )

VAR _Result =

SELECTCOLUMNS(

_2,"OrderID",[Order ID],

"Status",[Status]

)

RETURN

_Result

Here is the result 

 

Tejinder_2-1690235517874.png

 

 

I am not a trained Pbi user, whatever I have learned is from youtube and free tutorials

Any help is appreciated.

1 ACCEPTED SOLUTION
Tejinder
Helper I
Helper I

1 REPLY 1
Tejinder
Helper I
Helper I

..

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors