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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
sabilahmed
Resolver I
Resolver I

Calculated column from one table to another table

Hello,

 

I desperately need help with the following problem.

 

I have a calculated column in table "Config" which counts the number of instances per IV_Product_RecID (as there are "many" rows with multiple instances of IV_Product_RecID):

Count_IV_Product_RecID =

    CALCULATE(

        COUNT(Config[IV_Product_RecID]

            ),

            FILTER(

                Config,

                Config[IV_Product_RecID] = EARLIER(Config[IV_Product_RecID])

            )

    )

 

Then I have another table v_rpt_product with only "one" row per IV_Product_RecID. I have made sure there is a one-many relationship beween the two tables as depicted below:

 

sabilahmed_0-1645200212716.png

 

I need to add a calculated column in v_rpt_product telling me the number of times/ instances IV_Product_RecID shows up in the Config table.

 

I tried to "merge" the two tables so I could "expand" to return the calculated column from Config but this did not work as the merge feasture will not return the calculated column. Basically this would have worked in excel like a vlookup.

 

Please help me!

 

Thanks in advance,

S

1 ACCEPTED SOLUTION
sabilahmed
Resolver I
Resolver I

I've done it:

 

Created a calculated column in v_rpt_product:

 

Count_IV_Product_RecID = COUNTROWS(RELATEDTABLE(Config))

View solution in original post

3 REPLIES 3
sabilahmed
Resolver I
Resolver I

I've done it:

 

Created a calculated column in v_rpt_product:

 

Count_IV_Product_RecID = COUNTROWS(RELATEDTABLE(Config))
Anonymous
Not applicable

Have you tried merge queries in power query?

Yes - I mentioned that above, but it didn't work. Due to the nature of the calculation it doesn't appear as one of the columns to expand in the merge.

 

I'm thinking a better way to solve this issue is if I rephrase my questions to this:

How can I create a calculated column in my Config table to return the count of IV_Product_RecID from v_rpt_product table?

 

Remember:

Config has MANY ID's

v_rpt_product has UNIQUE ID's per row

 

Therefore this is a ONE-MANY relationship.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors