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
NISHA_S
Resolver I
Resolver I

wrong subtotals in matrix visuals

Hi everyone, 

 

I've got a problem with a matrix subtotals in the report.p11.PNGp12.PNG

For # of transaction column calaculation getting wrong subtotals in matrix table...I used some calcualtion for getting the # of transaction column.These column is used to calcualte count values.

VAR _Count1 =CALCULATE(DISTINCTCOUNT('table'[policy_or_group_reference]),FILTER('table',('table'[Transaction type] = "New Business" || 'table'[Transaction type] = "New MBR" || 'table'[Transaction type] = "New Reporter") && 'table'[endt_cert] = 0))
VAR _Count2 =CALCULATE(COUNTROWS(SUMMARIZE('table',
'table'[policy_or_group_reference] ,
'table'[endt_cert] )),FILTER('table',('table'[Transaction type] = "Endorsements" || 'table'[Transaction type] = "Cancellation" || 'table'[Transaction type] = "Reporter Endt") && ('table'[endt_cert] > 0 || 'table'[endt_cert] = 0)))
RETURN

if(isblank(_Count1), _Count2, _Count1)

 

These is the calcualtion i used while creating report...

Here ,total is calcualting  for 3 type only ie..New Business,New MBR,New Reporter only...balance is 3 type total is not considering....

21+1+3=25 getting which is not total for all type...

Plse help?

1 ACCEPTED SOLUTION
NISHA_S
Resolver I
Resolver I

subtotal_transaction = if(HASONEVALUE('table'[Transaction type]),[# of transaction],SUMX(VALUES('table'[Transaction type]),[# of transaction]))

View solution in original post

3 REPLIES 3
NISHA_S
Resolver I
Resolver I

subtotal_transaction = if(HASONEVALUE('table'[Transaction type]),[# of transaction],SUMX(VALUES('table'[Transaction type]),[# of transaction]))
v-yiruan-msft
Community Support
Community Support

Hi @NISHA_S ,

You can create another new measure as below base on the current measure [# of transaction], then put it on your matrix to replace the measure [# of transaction] .

Measure = SUMX ( GROUPBY ( 'table'[MTD], 'table'[Transaction type] ), [# of transaction] )

In addition, you can refer the content in the following links to resolve your problem.

Power BI Shows Incorrect Measure Total? How to fix it?

Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

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.
amitchandak
Super User
Super User

@NISHA_S , change return like give below, replace with correct un summarized columns in visual

sumx(summarize(Table, Table[MTD], Table[By transaction], "_1", if(isblank(_Count1), _Count2, _Count1)),[_1])

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.