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! Request now

Reply
SGradin
Regular Visitor

Power BI desktop not calculating total for measure in Matrix/Table

Hi,

 

I am fairly new to Power BI and learning as I go. I have encountered a problem I can not work around. When I create a new measure containing and IF statement that new measure does not add up in the measure Total. I am sure I do a very simple newbie error, but I can't seem to get it straight.

 

SCREEN.jpg

 

Above show the table I am trying to create. The formulae for the fist two columns (which works fine) are:

 

LY Account Retention = CALCULATE(DISTINCTCOUNT('Table'[Brand]),
SAMEPERIODLASTYEAR('Table'[Opportunity Start].[Date]))

 

CALAccountRetention = CALCULATE(DISTINCTCOUNT('Table'[Brand]))

 

The last column is where it goes wrong. The number for each line is correct, but I want the total to sum up the column as with the other columns.

 

Formula is

 

Account Retention = CALCULATE(
IF(
CALCULATE(
DISTINCTCOUNT('Table'[Brand]),
SAMEPERIODLASTYEAR('Table'[Opportunity Start].[Date]))
+ CALCULATE(
DISTINCTCOUNT('Table'[Brand]))=2,1,0)
)

 

Any help would be greatly appreciated!

 

S

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

@SGradin,

 

You may try to add an additional measure as follows.

Measure 2 =
SUMX ( VALUES ( 'Table'[Brand] ), [Measure] )
Community Support Team _ Sam Zha
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

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@SGradin,

 

You may try to add an additional measure as follows.

Measure 2 =
SUMX ( VALUES ( 'Table'[Brand] ), [Measure] )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello, 

I don't understand your reply, could you please detail more?

I have faced a similar issue as I was trying to make a roadmap using a matrix and calculating the sum of each column (date) on a given period. Before it was giving a wrong result and now that I have encapsulated my measure in SUMX() it does not give me a result at all.

Thanks for the input.

This helped to my issue even today.

Thanks a lot! That did the trick Smiley Happy

 

This solution will straighten out a few other question marks I have. Thanks for helping a beginner!

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