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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Divide value according to category in other table

I have two tables, the first shows the products and their ratio. The second shows the product and their values. I wish to create a new column to calculate the converted value (value/ratio) according to the respective product category. I tried to make a one-to-many relationship from first table to second table by linking 'product'. However, it only allows many-to-many relationship and both direction. How to make it one-to-many relationship and single direction? Any help given is appreciated. Thank you.

 

First table:

A.PNG

 Second table:

B.PNG

 

Expected output:

C.PNG

 

1 ACCEPTED SOLUTION
Whitewater100
Solution Sage
Solution Sage

Hi:

I beleive answer is same (actually provide Calc Col and Measure). The main thing was to answer the relationship question. Please see attached for that part. I hope this helps..

https://drive.google.com/file/d/1n_q1I9SuwHTEZXTSTQDFjQnX39uG0BXl/view?usp=sharing 

Whitewater100_0-1652187149375.png

Measure_Converted Value = SUMX(DATA, Data[Value] / Data[Ration])
Whitewater100_1-1652187208268.png

 

 

View solution in original post

4 REPLIES 4
Whitewater100
Solution Sage
Solution Sage

Hi:

I beleive answer is same (actually provide Calc Col and Measure). The main thing was to answer the relationship question. Please see attached for that part. I hope this helps..

https://drive.google.com/file/d/1n_q1I9SuwHTEZXTSTQDFjQnX39uG0BXl/view?usp=sharing 

Whitewater100_0-1652187149375.png

Measure_Converted Value = SUMX(DATA, Data[Value] / Data[Ration])
Whitewater100_1-1652187208268.png

 

 
Anonymous
Not applicable

Did you manually type in the Prod_ID column in the Data table? 

SanketBhagwat
Solution Sage
Solution Sage

Hi @Anonymous .

You can create a summary table using "SUMMARIZE'.
You can write your DAX as ;

Test =
SUMMARIZE(Table2,Table2[Product],Table2[Value],Table1[Equivalent Ratio])
 
Then create a calculated column for Converted Value using ;
Converted_Value =
DIVIDE(Test[Value],Test[Equivalent Ratio])


See below output;
SanketBhagwat_0-1652163356806.png



Thanks,
Sanket


If this post helps, then mark it as "Accept as Solution" and give it a thumbs up.

Anonymous
Not applicable

sry but I am not sure why the table 1 does not show up in the summarize function

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors