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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

New Columns through m to n relation

Hi,
I am new to the forum and have the following problem here. I have a m to n relationship between two tables. Now I want to check some conditions before writing anything from table A to table B. If you can see below, there is no unique key that it could be a many to many relation here. 

 

In the first step, I duplicated the "Value" column in Table A and added "Fee" and "Add. Information" columns. I do not know if this was a mistake. The goal here is from table A to write the information "Fee & Add. Information" to table B. I have already tried this with a lookupvalue or Calculate, but I am still too far from the solution for me to say anything is working. I'm also not sure if I'd rather build another table or something else. Please help.

 

Table A - Concession Table:

Door Nr.Brand Nr.Supplier Nr.Sortiment Nr.Field descriptionValueFeeAdd. Information
23212345758420Fee1212Null
12312345758420Add. InformationInfosNullInfos
2321234345610Fee3232Null
1231234345610Fee4343Null

 

Table B - Sales Table:

Door Nr.Brand Nr.Supplier Nr.Sortiment Nr.Kind of purchaseNet SalesFeeAdditional Information
23212345758420Concession100??
23212345758410Concession200??
23212345685920Concession30??
1231234345610Concession40??

 

Thanks in advanced,

Sebastian

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Anonymous,

Do you mean this requirement is more related to lookup values from another table based on current table field values? If that is the case, you can try to use the following formals to get value from other tables:

Fee =
CALCULATE (
    SUM ( Concession[Fee] ),
    FILTER (
        Concession,
        [Door Nr.] = EARLIER ( Sales[Door Nr.] )
            && [Brand Nr.] = EARLIER ( Sales[Brand Nr.] )
            && [Supplier Nr.] = EARLIER ( Sales[Supplier Nr.] )
            && [Sortiment] = EARLIER ( Sales[Sortiment] )
    )
)

Additional Information =
CALCULATE (
    CONCATENATEX (
        VALUES ( Concession[Add. Information] ),
        [Add. Information],
        ","
    ),
    FILTER (
        Concession,
        [Door Nr.] = EARLIER ( Sales[Door Nr.] )
            && [Brand Nr.] = EARLIER ( Sales[Brand Nr.] )
            && [Supplier Nr.] = EARLIER ( Sales[Supplier Nr.] )
            && [Sortiment] = EARLIER ( Sales[Sortiment] )
    )
)

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

HI @Anonymous,

Perhaps you can take a look at the following blog to create a bridge table for many to many relationship table records mappings:

How to Join Many to Many with a Bridge Table in Power BI | Seer Interactive

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Sorry, but this is a total another problem. And the solution is from 2019 where no many to many relationship in Power BI exist.

Anonymous
Not applicable

HI @Anonymous,

Do you mean this requirement is more related to lookup values from another table based on current table field values? If that is the case, you can try to use the following formals to get value from other tables:

Fee =
CALCULATE (
    SUM ( Concession[Fee] ),
    FILTER (
        Concession,
        [Door Nr.] = EARLIER ( Sales[Door Nr.] )
            && [Brand Nr.] = EARLIER ( Sales[Brand Nr.] )
            && [Supplier Nr.] = EARLIER ( Sales[Supplier Nr.] )
            && [Sortiment] = EARLIER ( Sales[Sortiment] )
    )
)

Additional Information =
CALCULATE (
    CONCATENATEX (
        VALUES ( Concession[Add. Information] ),
        [Add. Information],
        ","
    ),
    FILTER (
        Concession,
        [Door Nr.] = EARLIER ( Sales[Door Nr.] )
            && [Brand Nr.] = EARLIER ( Sales[Brand Nr.] )
            && [Supplier Nr.] = EARLIER ( Sales[Supplier Nr.] )
            && [Sortiment] = EARLIER ( Sales[Sortiment] )
    )
)

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.