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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
abc_777
Super User
Super User

Table over a table

Hi,

 

I have a following relationship where the customer table is related to ssummary (one to many) tables then summary table have a relation to the sale table (many to many)

 

and so when i do the following measure it gives me the incorrect result

 

can someone help me out, please

 

abc_777_0-1638197494347.png

 

% of Actual Quantity (CONCATANATEX Assignment) =
VAR AllExceptQuantity=

CALCULATE(
'Measure Table'[Actual Quantity (Measure) (KG)], >>>>>>>> this a measure of total quantity
ALLEXCEPT(
'bm_retail_t ssummary', >>> instead of this one here 
'bm_retail_t sale', >>>>>>>> i want  to be here
'bm_retail_t customer'[EMPLOYEE_CODE])
)
VAR Ratio=
DIVIDE(
'Measure Table'[Actual Quantity (Measure) (KG)],
AllExceptQuantity,
BLANK()
)
RETURN
Ratio

 

 

thanks

1 ACCEPTED SOLUTION

Can't you create a bridge table?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

8 REPLIES 8
PaulDBrown
Community Champion
Community Champion

If Customer ID and Customer Code are different fields you can't create a relationship (and you should delete the one you have in place).

As regards your other question, you can use CROSSFILTER to activate a many-to-one relationship 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






thanks paul,

 

i have made the solution by merging columns in another way. but really great that you always touch on me and suggest me. thanks you again

PaulDBrown
Community Champion
Community Champion

The wrong result may have to do with the fact that two tables have a many-to-many relationship





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






yes, paul, and the database designer make this incorrect table relationship. there is no Key that I can join with the customer table direct to the sale table.

 

So I need a measure or DAX formula or solution that I can over calculate customer and sale table

 

thanks

Can't you create a bridge table?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






i have company code in the sale table and ssummary table and 

 

customer_id  in the customer table and Customer_code in ssummary table

 

would be able to help me how i create bridge using distinct

You can create the bridge table using the equivalent to:

Customer Table =
DISTINCT (
    UNION (
        VALUES ( 'Customer Table'[Customer ID] ),
        VALUES ( 'Summary table'[Customer ID] )
    )
)




Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi paul

thanks for your reply.

 

I have many-to-many relation to ssummary and sales table that has 

customer_id  in the customer table and Customer_code in ssummary table

 

how i make bridge table in this case 

 

moreover, i am querying from customer tale to sales but ssummary table is in middle of customer and sales table

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.