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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
RJB0412
Regular Visitor

Calculation across a bridge Table

We are trying to analyse turnover projections based on a number of scenarios of price and sales volumes. We have 2 tables, one for price scenarios and one for volume scenarios. We can't join the 2 tables as this would result in a many-to-many relationship, so we have created a bridge table. I need to create a measure for Revenue as Price * Qty.

RJB0412_2-1691396141041.png

Above, is a simple example, our bridge key is a combination of Year, Week and Product. (In our real tables it is an 8 field combination).

We want to be able to compare the revenue from PS1 and VS1 & VS2 or VS1 and PS1 & PS2 etc.

Thank you in advance for any advice.

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

I don't bother to create such a bridge table given that the composite key consists of so many columns. TREATAS() does the trick.

Revenue =
SUMX(
    Volumes,
    Volumes[Qty]
        * CALCULATE(
            MAX( Prices[Price] ),
            TREATAS(
                CALCULATETABLE(
                    SUMMARIZE(
                        Volumes,
                        Volumes[Year], Volumes[Week], Volumes[Product],Volumes[Xxxx]
                    )
                ),
                Prices[Year], Prices[Week], Prices[Product],Prices[Xxxx]
            )
        )
)


Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

3 REPLIES 3
ThxAlot
Super User
Super User

I don't bother to create such a bridge table given that the composite key consists of so many columns. TREATAS() does the trick.

Revenue =
SUMX(
    Volumes,
    Volumes[Qty]
        * CALCULATE(
            MAX( Prices[Price] ),
            TREATAS(
                CALCULATETABLE(
                    SUMMARIZE(
                        Volumes,
                        Volumes[Year], Volumes[Week], Volumes[Product],Volumes[Xxxx]
                    )
                ),
                Prices[Year], Prices[Week], Prices[Product],Prices[Xxxx]
            )
        )
)


Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



This did the trick nicely. Thanks

mussaenda
Super User
Super User

Hi @RJB0412,

 

You are doing it right and you are close to getting your requirement.

I would suggest to include the Product, Scenarios or other details you need on the bridge retaining the relationship you already have and use those fields on yuor report and calculate you revenue as measure.

 

Hope this helps

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors