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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Calculate discounted rate where it match name from other table

Hi All, 

 

I have two tables the relationship in the column 'Type' . I want to Sum 'Price A' and 'Price B' then multiply by the value that matchs the type name from Table1. 

 

I tried this " =sumx( table1, table1[Price A] + table1[price B] * related( 1+ Table2[Discount]))), but it returened wrong discounted value. 

 

Is there any other way ? 

 

 

Table1:

 

TypePrice APrice B
A11560
B8440
C1150
D5188
D2265
E22170
E6688
E6615
A6612
A6622

 

Table2 :

 

TypeDiscount
A-0.05
B-0.04
C0.9
D0.7
E0.8

 

Thank you in advance!

1 ACCEPTED SOLUTION

@Anonymous

 

I get 166.25 as well Smiley Surprised

 

 

 cdr.png

 


Regards
Zubair

Please try my custom visuals

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Do you want new column in Table1?

 

Try Something like this

 

Column =
 ( table1[Price A] + table1[price B] )
    * ( 1 + RELATED ( Table2[Discount] ) )

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

 It doesn't work. I want the sum value from table1 - percnet from table2 , but only when type match. For example; Type "A" should calcuate the sum of Price A and Price B then multiply by the Type A from Table2 which is -.05. I should get 166.25. 

 

Thank you, 

@Anonymous

 

I get 166.25 as well Smiley Surprised

 

 

 cdr.png

 


Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.