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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

If tow column values are not equal, then 3rd column values replaced by 0.

Dear Expert,

 

Pleaes provide the solution for the below query:

we have two columns called SCM WareHouse & SAP B1 WareHouse. If these two coluns warehouses are not equal then SCM OnHand values should be replaces by 0 existing value. 

For better understanding please have a look on attached screen shots:
Expecting the colume SCM OnHand column which highlighted with colour in Result table.

Logic: IF(SCM WareHouse <> SAP B1 Warehouse) then SCM OnHand exisiting 315 value should be filled with 0.
for matching WareHouses values should not be changed.

SareenModem_0-1671118612343.pngSareenModem_1-1671118653030.png

 

 Thanks,

Sarenn

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

 

Here are the steps you can follow:

1. Create calculated column.

SCM OnHand =
var _flag=ISERROR ( VALUE ('Table'[SAP B1 WareHouse]))
return
IF(
    _flag=FALSE() && FORMAT('Table'[SCM WareHouse],"General Number") = 'Table'[SAP B1 WareHouse],[SAP B1 OnHand],0)

2. Result:

vyangliumsft_0-1671171184416.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

View solution in original post

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

 

Here are the steps you can follow:

1. Create calculated column.

SCM OnHand =
var _flag=ISERROR ( VALUE ('Table'[SAP B1 WareHouse]))
return
IF(
    _flag=FALSE() && FORMAT('Table'[SCM WareHouse],"General Number") = 'Table'[SAP B1 WareHouse],[SAP B1 OnHand],0)

2. Result:

vyangliumsft_0-1671171184416.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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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