Forum Discussion

krish007na's avatar
krish007na
New Member
5 years ago
Solved

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. 

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?

  • Anonymous's avatar
    Anonymous
    5 years ago

    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])

    Best Regards

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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])

    Best Regards

  • 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])
    )

      • Fowmy's avatar
        Fowmy
        Super User

        krish007na 

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