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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Measure to determine order count with filter

HI everyone, I need some help.

 

I am trying to determine the OTIF measure of a table that has detailed order data. The structure is the following:

 

DATEOrderNoSKUQTYQTY_ORDEREDQTY_DEILVERDQTY_NOT_DELIVEREDCATEGORYCPGROUTE

 

The QTY field could be a positive or negative quantity that indicates if the SKU (an article or product) was ordered or rejected. Some sample data are this:

sample.JPG

In order to get OTIF Measure (#Orders Fully Delivered / #Total Orders), I need to get the count of orders that match the condition that QTY_ORDERED == QTY_DELIVERED, counting by order_no.

I've created this measure:

In Full = CALCULATE(DISTINCTCOUNT(PruebaOrdenesOper[NRO_PEDIDO]), FILTER(PruebaOrdenesOper, SUM(PruebaOrdenesOper[PROD_PEDIDOS]) == SUM(PruebaOrdenesOper[PROD_ENTREGADOS])))
 
But this doesn't work. When I see all the data with OrderNo and quantities summarized, this measure seems to work ok,
measure.JPG
But when I going to count without orderNo (only by date), the measure doesn't work anymore:
InFull Not working.JPG
 
My idea for OTIF is to do after all a division InFull / COUNT_PEDIDOS. So I Need to determine the count of orders that match these condition (QTY_ORDERED == QTY_DELIVERED). This measure it depends on the qualifier, you could see OTIF by CPG, by ROUTE, By Model, Brand, etc. 
 
Anyone can help me?
Thanks!
3 REPLIES 3
Anonymous
Not applicable

Hi  @Anonymous ,

According to your picture, when you remove [orderNo], the entire visual object will be grouped with [FECHA] for aggregation, but your [FECHA] is the same, so only one row of aggregated data will be displayed, When your [orderNo] exists, the entire visual object will be grouped and aggregated with [FECHA], [orderNo].

1. If you don't want to see the [orderNo] column, you can make it white by clicking Field formatting

vyangliumsft_0-1644973566667.png

vyangliumsft_1-1644973566669.png

2. Place its field in the last column and hide it in the drag window.

vyangliumsft_2-1644973566671.png

3. Or click power query, Add Column – Index Column – From 1. Use the [Index] column instead.

vyangliumsft_3-1644973566674.png

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

This solution is not acceptable because I need it as measures to render in a chart. The final result should be a bar chart, not a table. So it isn't an acceptable solution to hide a column in a table.

amitchandak
Super User
Super User

@Anonymous , Create a new measure on the top of it and use

 

sumx(addcolumns( Summarize(PruebaOrdenesOper,PruebaOrdenesOper[NRO_PEDIDO],Date[Fecha]), "_1", [In Full]) ,[_1])

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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