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
jurkowskij
Frequent Visitor

Count customers with On Time Shipment

Hi,

 

I try to create a measure that count how many customer had their shipment on time (All Shipments on time) in this year

 

Example data

Customer ExpectShipmentDate ShipmentDate 

Datediff

Customer 1 2023-03-01 2023-03-01 

0

Customer 1 2023-03-03 2023-03-03 

0

Customer 2 2023-03-01 2023-03-02 

1

Customer 2 2023-03-03 2023-03-03 

0

Customer 3 2023-03-01 2023-03-03 

2

Customer 3 2023-03-03 2023-03-04 

1

 

Only Cumtomer 1 had all shipments on time so my measure should return 1

I try something like this:

 

 

 

COUNTROWS( 
FILTER   (
           SUMMARIZE(
               'Table',
               'Table'[Customer]               
               , "Datediff" 
               ,CALCULATE(SUM('Table'[Datediff]),
               YEAR('Table'[ShipmentDate])=year(today())) 
                )
                ,"Datediff"=0
        )
        )
        

 

 

 

 

In my opinion it should works, but i Have this error:

 

MdxScript(Model) (68, 18) DAX comparison operations do not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jurkowskij 

1.Please check that the data type of your ShipmentDate column or datediff column, whether the type is "Text" instead of "Date" or "Whole number".
2.You can refer to the following measure

Measure = var a=SUMMARIZE(
               'Table',
               'Table'[Customer]               
               , "Sum",SUM('Table'[Datediff])
)
return COUNTROWS(FILTER(a,[Sum]=0))

vxinruzhumsft_0-1683771604253.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @jurkowskij 

1.Please check that the data type of your ShipmentDate column or datediff column, whether the type is "Text" instead of "Date" or "Whole number".
2.You can refer to the following measure

Measure = var a=SUMMARIZE(
               'Table',
               'Table'[Customer]               
               , "Sum",SUM('Table'[Datediff])
)
return COUNTROWS(FILTER(a,[Sum]=0))

vxinruzhumsft_0-1683771604253.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

It seems to work. thanks a lot

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors