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
Salauat
Regular Visitor

DAX: Total price from two tables

Hello, I have two tables.

In first table I have multiple Man.Model repeated N times.

In second table I also have Man.Model, but repeated once.

 

Product table:

  • Device name
  • Manufacturer model
  • Date expire

 

Unit Price table:

  • Manufacturer model
  • Unit Price

I am trying to create New Measure, which will be counting Total Price = Product[Count_of Man.Model] * Unit Price[Unit Price]

I have placed simple Table visual in my report with filter by Date expire and I need above Measure to be recalculated every time, when filter changes

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Salauat , if there is one to many relation then you can try like

Total Price =sum( Product[Count_of Man.Model] )* maxx(Product, related(Unit Price[Unit Price]))

 

 

else refer these ways to copy value from one table to another : https://www.youtube.com/watch?v=czNHt7UXIe8

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Salauat , if there is one to many relation then you can try like

Total Price =sum( Product[Count_of Man.Model] )* maxx(Product, related(Unit Price[Unit Price]))

 

 

else refer these ways to copy value from one table to another : https://www.youtube.com/watch?v=czNHt7UXIe8

@amitchandak Seems the formula you provided is not calculating the total correctly.

It multiplies Count * Unit_Price, but the overall rows total is not correct, it's way too huge

Hello @amitchandak !

Thank you, the correct formula that worked for me is below:

 

Total = SUM(Product[Count_of Man.Model] )* counta(Product, related(Unit Price[Unit Price]))

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.

Top Solution Authors