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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

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
Community Champion
Community Champion

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.