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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
darkmetrics
Helper I
Helper I

How to prevent total row in matrix from summation of all values?

Good afternoon!
I have data like

darkmetrics_0-1663053507597.png

 

I made 2 measures: one for current month sales, one for current month plan and one for current month plan completion. They work fine. However, when I create a matrix in Power BI, total plan completion strangely sums all individual plan completion values for each channel:

darkmetrics_1-1663053703126.png

 


How can I fix that?

Below are my measures:

 

 

CurrentMonthPlan := 

var CurrentYear = YEAR(TODAY())
var CurrenMonth = MONTH(TODAY())

RETURN
CALCULATE(
SUMX(FILTER('Sales', 
            YEAR('Sales'[Date]) = CurrentYear &&
            MONTH('Sales'[Date]) = CurrenMonth
            ),
    'Sales'[Plan]),
    ALL('Sales'[date])
)

CurrentMonthActiveSales := 

var CurrentYear = YEAR(TODAY())
var CurrenMonth = MONTH(TODAY())

RETURN
CALCULATE(
SUMX(FILTER('Sales', 
            YEAR('Sales'[Date]) = CurrentYear &&
            MONTH('Sales'[Date]) = CurrenMonth
            ),
    'Sales'[Active sales]),
    ALL('Sales'[date])
)


CurrentMonthPlanCompletion := 

var CurrentYear = YEAR(TODAY())
var CurrenMonth = MONTH(TODAY())

RETURN
CALCULATE(
SUMX(FILTER('Sales', 
            YEAR('Sales'[Date]) = CurrentYear &&
            MONTH('Sales'[Date]) = CurrenMonth
            ),
    'Sales'[CurrentMonthActiveSales] / 'Sales'[CurrentMonthPlan]),
    ALL('Sales'[date])
)

 

 

1 ACCEPTED SOLUTION
Adescrit
Impactful Individual
Impactful Individual

Hi @darkmetrics 

 

It's returning the total of the percentages added up because the SUMX function is telling it SUM the result of the 'Sales'[CurrentMonthActiveSales] / 'Sales'[CurrentMonthPlan]) calculation.

 

Since you have already defined CurrentMonth and CurrentYear in the CurrentMonthActiveSales and CurrentMonthPlan measures, I wonder if you can simplify the CurrentMonthPlanCompletion calculation as follows:

 

CurrentMonthPlanCompletion = DIVIDE( 'Sales'[CurrentMonthActiveSales],  'Sales'[CurrentMonthPlan] )

 

 


Did I answer your question? Mark my post as a solution!
My LinkedIn

View solution in original post

2 REPLIES 2
darkmetrics
Helper I
Helper I

Thank you, I have removed my additional layer of summation and now it works fine.

Adescrit
Impactful Individual
Impactful Individual

Hi @darkmetrics 

 

It's returning the total of the percentages added up because the SUMX function is telling it SUM the result of the 'Sales'[CurrentMonthActiveSales] / 'Sales'[CurrentMonthPlan]) calculation.

 

Since you have already defined CurrentMonth and CurrentYear in the CurrentMonthActiveSales and CurrentMonthPlan measures, I wonder if you can simplify the CurrentMonthPlanCompletion calculation as follows:

 

CurrentMonthPlanCompletion = DIVIDE( 'Sales'[CurrentMonthActiveSales],  'Sales'[CurrentMonthPlan] )

 

 


Did I answer your question? Mark my post as a solution!
My LinkedIn

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.