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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Yian
Frequent Visitor

Measure total incorrect

Dear Community,

 

I have the following measure written for a calculation involving two columns from two tables with a many-to-many relationship.

 

The first table is the 'Transactions Breakdown Table'. This table comprises various expenses incurred for each portfolio. Some portfolios have only one expense (a single row of data), while others have multiple expenses (multiple rows of data for one item). Each expense has a corresponding account number. 

PortfolioExpenseAccount number
abc1100123
abc1100124
abc1100125
abc21100123
abc22100123
abc23100123
abc24100123
abc25100123
abc26100123
abc27100123
abc28100123
abc2910000123

 

The second table is the 'Ownership mapping' table. It displays the percentage share of each client's expenses for each portfolio. A value of 1 represents 100%, and 0.04 signifies 4%. Some portfolios have only one client, while others have more than one.

Client OwnershipClientPortfolio
1Maryabc1
1Lilyabc2
1Lilyabc3
1Lilyabc4
1Johnabc5
1Johnabc6
1Johnabc7
1Maryabc8
1Henryabc9
0.04Lilyabc10
0.025Johnabc10
0.35Jessicaabc10
0.25Zoeyabc10
0.011Aberleneabc10
0.183Joannaabc10
0.076Maggieabc10
0.065Maryabc10

 

For each expense in every portfolio, I would like to calculate the share of the expense for each corresponding client. However, when I use this measure as values in a matrix table, the grand row total is adding up correctly but the row values are not correct. I went on to create measure 2, which gives me correct row values but incorrect grand row total. Appreciate if anyone could provide any help. Thanks in advance!

 

Measure =
var net_amt = CALCULATE(SUM('Transactions Breakdown'[Expense]))  
var cnt_own = CALCULATE(MAX('Ownership mapping'[Client Ownership]))  
return net_amt * cnt_own

Measure 2 =
SUMX(
    SUMMARIZE(
        'Ownership mapping',
        'Ownership mapping'[Client],
        'Ownership mapping'[Portfolio],
        "TotalOwnership", SUM('Ownership mapping'[Client Ownership])
    ),
    [Measure]
)


1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Yian 

 

You can try the following methods.

Measure 3 = IF(HASONEVALUE('Ownership mapping'[Client]),[Measure 2],[Measure])

vzhangti_0-1692185168171.png

Is this the result you expect? If not, please provide the output you expect.

 

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @Yian 

 

You can try the following methods.

Measure 3 = IF(HASONEVALUE('Ownership mapping'[Client]),[Measure 2],[Measure])

vzhangti_0-1692185168171.png

Is this the result you expect? If not, please provide the output you expect.

 

Best Regards,

Community Support Team _Charlotte

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

amitchandak
Super User
Super User

@Yian , multiplication needs to be done at row level and then needs to be summed up. if not possible then use common columns

 

preferably from common dimension/on visual columns

 

Sumx(Values(Dim[Column]), CALCULATE(SUM('Transactions Breakdown'[Total]) * MAX('Ownership mapping'[Client Ownership])) )

 

Use summarize for more than one column

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi,

 

Thanks for the reply. But the solution didn't work out. I just edited my original post and added more information. Please take a look. Thanks very much!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors