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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
JemB123
Helper I
Helper I

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!




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 @JemB123 ,

 

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 @JemB123 ,

 

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

JemB123_0-1730421912767.png

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors