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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Help - Show when data doesnt match

Hi, 

 

Could you please create me a powerbi measure to filtre data to only show sales order numbers where the warehouse doesnt match the po numbers warehouse putting a Y for Mismatched and N for matched- the data : Purchasing ;Warehouse . SalesOrderItems; Warehouse, Order Number, PO Number. there is a relationship between SaleOrderItems; PO Number and Purchasing: Order Number.

 

sample Data: 

SalesOrdersItems 

Order NumberWarehouse PO Number 
225976Direct to Customer25641
265897Direct to Customer25643
265389East25645
265972General25649
225978West 25647
226594General

25646

 

Purchasing 

Purchase order number WarehouseSales Order number 
25641Direct to Customer225976
25643General 265897
25645General 265389
25649East265972
25647West225978
25646Direct to Customer226594

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

you can try this

 

Column =
var _w=maxx(FILTER(Purchasing,Purchasing[Purchase order number ]=SalesOrdersItems[PO Number ]&&SalesOrdersItems[Order Number]=Purchasing[Sales Order number ]),Purchasing[Warehouse])
return if( _w=SalesOrdersItems[Warehouse ],"Y","N")
 
11.PNG
pls see the attachment below
 




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

Proud to be a Super User!




View solution in original post

6 REPLIES 6
ryan_mayu
Super User
Super User

you can try this

 

Column =
var _w=maxx(FILTER(Purchasing,Purchasing[Purchase order number ]=SalesOrdersItems[PO Number ]&&SalesOrdersItems[Order Number]=Purchasing[Sales Order number ]),Purchasing[Warehouse])
return if( _w=SalesOrdersItems[Warehouse ],"Y","N")
 
11.PNG
pls see the attachment below
 




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

Proud to be a Super User!




Anonymous
Not applicable

Hi, I got an error: The syntax for 'return' is incorrect. (DAX(maxx(FILTER(Purchasing,Purchasing[Order Number]=SalesOrdersItems[PO Number]&&SalesOrdersItems[Order Number]=Purchasing[Sales Order No]),Purchasing[Warehouse])return if( _w=SalesOrdersItems[Warehouse],"Y","N"))).

Anonymous
Not applicable

Hi @Anonymous ,

 

I reproduced your error below.

vstephenmsft_0-1731402255251.png

Your problem is that the var definition is missing. After adding "var _w=" and it worked.

vstephenmsft_1-1731402318252.png

Hope it helps.

 

Best Regards,

Stephen Tao

 

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

 

could you pls provide your pbix file?





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

Proud to be a Super User!




FreemanZ
Super User
Super User

hi @Anonymous ,

 

for "relationship between SaleOrderItems; PO Number and Purchasing: Order Number.", which is one side?

Anonymous
Not applicable

JemB123_0-1730421912767.png

 

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