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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Omelei
Frequent Visitor

Get data from table

Hi guys, 

 

Hope you can help me out. 

 

I have 2 tables

 

Productconfig

 

Omelei_1-1670573673233.png

 

Opportunity

 

Omelei_2-1670573701107.png

 

Connection

 

Omelei_0-1670573368191.png

 


Now, I'd like to add an additional column in Productconfig Table with the Quantity of the Product from the Previous Opportunity

Any idea?

2 ACCEPTED SOLUTIONS
Samarth_18
Community Champion
Community Champion

HI @Omelei ,

 

You can create a column as below:-

 

Column =
LOOKUPVALUE (
    Opportunity[prev opp id],
    Opportunity[Opp id], OpportunityConfig[opportunity id]
)

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

Anonymous
Not applicable

Hi @Omelei ,

Please try to create a new column with below dax formula:

 

Column =
VAR cur_oid = [Opportunity ID]
VAR o_id =
    CALCULATE (
        MAX ( Opportunity[Previous Opportunity ID] ),
        Opportunity[Opportunity ID] = cur_oid
    )
VAR cur_pid = [Product ID]
VAR _val =
    CALCULATE (
        MAX ( Productconfig[Quantity] ),
        FILTER (
            ALL ( Productconfig ),
            [Product ID] = cur_pid
                && [Opportunity ID] = o_id
        )
    )
RETURN
    _val

 

vbinbinyumsft_0-1670825656909.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
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

3 REPLIES 3
Anonymous
Not applicable

Hi @Omelei ,

Please try to create a new column with below dax formula:

 

Column =
VAR cur_oid = [Opportunity ID]
VAR o_id =
    CALCULATE (
        MAX ( Opportunity[Previous Opportunity ID] ),
        Opportunity[Opportunity ID] = cur_oid
    )
VAR cur_pid = [Product ID]
VAR _val =
    CALCULATE (
        MAX ( Productconfig[Quantity] ),
        FILTER (
            ALL ( Productconfig ),
            [Product ID] = cur_pid
                && [Opportunity ID] = o_id
        )
    )
RETURN
    _val

 

vbinbinyumsft_0-1670825656909.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Samarth_18
Community Champion
Community Champion

HI @Omelei ,

 

You can create a column as below:-

 

Column =
LOOKUPVALUE (
    Opportunity[prev opp id],
    Opportunity[Opp id], OpportunityConfig[opportunity id]
)

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Thank you for your reply @Samarth_18 . There can be multiple products in 1 opportunity. 

 

I made a start now with the concatenate function:

 

opportunityid + productid

previous opportunityid + product id

 

Omelei_0-1670672375138.png

 

Now I need to add another column with the quantity of the product in the previous opportunity. I tried to use the following:

 

Column = LOOKUPVALUE(Quantity,Merge Opportunity + ProductID,Merge Previous Opportunity + ProductID)

 

However, LOOKUPVALUE does not work with expressions.

 

Any thoughts?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.