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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Peter32
Frequent Visitor

Add Column with data from other table

Hello,

I think I have a little problem, but I just can't figure it out, please help me.

 

Table 1 Sales

Column = Salesemployee

Joe

Jim

Eveline

Sam

Sandra

Table 2 Orders

Columns =   Ordernumber

Orderdate

Orderamount

Discount

 

Question: I want to work with the columns in the table 2 Orders excluding the orders from Joe and Eveline. 

That's why I want to add a column in table 2 Orders in which the status "include" or "exclude" is stated per order in order to be able to filter with this.

 

What is the best way to do this, or are there other solutions.

 

Thanks!

 

1 ACCEPTED SOLUTION
Sahir_Maharaj
Super User
Super User

Hello @Peter32,

 

Can you please try to add a new calculated column to the "Orders" table:

Status = 
IF (
    Orders[Salesemployee] = "Joe" || Orders[Salesemployee] = "Eveline",
    "exclude",
    "include"
)

 Should you require further assistance please do not hesitate to reach out to me.


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

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 13K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

View solution in original post

2 REPLIES 2
v-xinruzhu-msft
Community Support
Community Support

Hi @Peter32 

First you need to find the related ordernumber with Joe/Eveline, if you have the ordernumber in Sales table, then you can create a new column in Orders table 

Column =
VAR a =
    SUMMARIZE (
        FILTER ( Sales, [ordernumber] = EARLIER ( Orders[ordernumber] ) ),
        [Salesemployee]
    )
RETURN
    IF ( OR ( "Joe" IN a, "Eveline" IN a ), "include", "exclude" )

Best Regards!

Yolo Zhu

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

 

Sahir_Maharaj
Super User
Super User

Hello @Peter32,

 

Can you please try to add a new calculated column to the "Orders" table:

Status = 
IF (
    Orders[Salesemployee] = "Joe" || Orders[Salesemployee] = "Eveline",
    "exclude",
    "include"
)

 Should you require further assistance please do not hesitate to reach out to me.


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

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 13K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

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.