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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
madhushree
Frequent Visitor

subtotals and grandtotal are not correct in matrix when i use DAX DISTINCTCOUNT

Hi All, I am getting subtotals and grandtotal incorrect in matrix when i use DAX DISTINCTCOUNT. Below screenshot shows the report where i am counting distinct agreements for each partner and sales. But in subtotals also i need the total to be proper. For example 1st total should come as 5 instead of 3. Below are the screenshots of dimensions and fact. Can anyone please help me to get proper total.

This is reportThis is reportAgreement dimensionAgreement dimensionfactfactPartner dimensionPartner dimensionsales.PNG

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @madhushree,

 

Making the calculation of distinct count what is done is based on the context of your pivot table I have added the aggreement i key in the pivot table and in your fact table for partner a you only have 3 agreements althougth they are distributed by 4 sales person that why the total is 3 and not 5.

 

You can make a measure and then add a new column and use it the count you need.

 

MEASURE

distinct_count_agree = DISTINCTCOUNT('fact'[agrmnt key])

COLUMN

AGRMT_COUNT = [distinct_count_agree]

Then you will get the expected result.

 

agr.png

 

Regards,

MFelix

 

 

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @madhushree,

 

Making the calculation of distinct count what is done is based on the context of your pivot table I have added the aggreement i key in the pivot table and in your fact table for partner a you only have 3 agreements althougth they are distributed by 4 sales person that why the total is 3 and not 5.

 

You can make a measure and then add a new column and use it the count you need.

 

MEASURE

distinct_count_agree = DISTINCTCOUNT('fact'[agrmnt key])

COLUMN

AGRMT_COUNT = [distinct_count_agree]

Then you will get the expected result.

 

agr.png

 

Regards,

MFelix

 

 

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



hi i have somehow same problems to get currtect column summurization or rowwise sumurization,

please could u quide me how can i get sum in visual level number from each months.

please check the picture attachedInkedseriousQues_LI.jpg

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.