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
krish007na
New Member

Measure Total not correct when created from 2 different tables

I have 2 tables as ProductTarget and Signals. I want to create a measure like ProductTarget[Target] *  Signals[Value]. Some of the ProductTarget[Target] values are 0. So the multiplication will be 0.
I have used Dax like SUMX(ProductTarget[Target]) *  SUMX(Signals[Value]). It gives correct values at row level, but total is incorrect. 

krish007na_0-1623391017646.png

If you see the total should be 0.02 as second value 0. But instead total is showing like total(sum) of Value (0.65) * total(sum) of target(0.0449) = 0.03.
I want to do multiplication and then summation. But in this case it is doing summation first and then multiplication. 
How do I can acheive this?

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @krish007na ,

You can create another new measure as below to replace the previous measure [Port wgt avg]:

Measure = SUMX(GROUPBY('ProductTarget','ProductTarget'[BMName],'ProductTarget'[Desc]),[Port wgt avg])

yingyinr_0-1623839343783.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-yiruan-msft
Community Support
Community Support

Hi @krish007na ,

You can create another new measure as below to replace the previous measure [Port wgt avg]:

Measure = SUMX(GROUPBY('ProductTarget','ProductTarget'[BMName],'ProductTarget'[Desc]),[Port wgt avg])

yingyinr_0-1623839343783.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Fowmy
Super User
Super User

@krish007na 

Hope these two tables are connected using a relationship?

Try this measure, if it doesn't work share your sample PBIX file.

Port Exp Wgt =
SUMX(
ProductTarget,
ProductTarget[Target] * RELATED (Signals[Value])
)

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

RELATED is not working 

@krish007na 

Please share a sample PBIX file. You can save in Google or One Drive and share the link here.


Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@krish007na 

Your model needs to be fixed first. You have created Many-to-many relationship and the whole file behaves unexpectedly.
If Signal is the dimension file, remove duplicates from the Column "Sedol" and set the relation to One-To-Many.
 

Fowmy_0-1623410633773.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.