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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
MaWrob
New Member

Conditional Statement between two related tables

Hello,

I am attempting to write a statement between two related tables.

 

Table 1:

- Order ID

- Order Status

 

Table 2:

- ORder ID

- ORder Value

 

I want to get a column which would say:

: IF table 1 Order status in (cancel, returned) AND Table 2 ORder Value = 0 then 1 else 0

 

How can I write this? Joining these tables in Power Query is not an option. Tables are big and there are lots of other columns in each

1 ACCEPTED SOLUTION
Uzi2019
Super User
Super User

Hi @MaWrob 
Create calculated column as below

 

Status= 

IF( AND(Table1[OrderStatus] in {"cancel", "returned"} , Table2[Order Values]=0), 1,0)

 

I hope This might solved your issue!

Note : I hope you have connected 2 tables properly.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

2 REPLIES 2
Uzi2019
Super User
Super User

Hi @MaWrob 
Create calculated column as below

 

Status= 

IF( AND(Table1[OrderStatus] in {"cancel", "returned"} , Table2[Order Values]=0), 1,0)

 

I hope This might solved your issue!

Note : I hope you have connected 2 tables properly.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
TomMartens
Super User
Super User

Hey @MaWrob ,

 

you did not describe how both tables are related (granularity and filter direction) and where you want the calculated column.

 

Consider creating a pbix file containing sample data that still reflects your semantic model (tables, relationships, calculated columns, and measures). Upload the pbix file to OneDrive, Google Drive, or dropbox and share the link. Do not forget describe the expected result based on your sample data.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.