cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Sum of Distinct count is not matching with export data, row by row there is no difference!!!

Hi,

 

Total of distinct count of score id is not matching with export output. Total of count is matching but not total of distinct count.

 

Dax used: I tried sumx and other formulas, still the same result, sum of distinct count is calculated in a different way in Power Bi?

 

2020 data = CALCULATE(DISTINCTCOUNT(Sheet1[Score id]),'Sheet1'[Score_Year] IN { 2020 })

2019 data = CALCULATE(DISTINCTCOUNT(Sheet1[Score id]),'Sheet1'[Score_Year] IN { 2019 })

sumx 2020 = sumx(values(Sheet1[Score id]),CALCULATE(DISTINCTCOUNT(Sheet1[Score id]),Sheet1[Score_Year]=2020))

Sumx 2019 = sumx(values(Sheet1[Score id]),CALCULATE(DISTINCTCOUNT(Sheet1[Score id]),Sheet1[Score_Year]=2019))

 

2020 total distinct count of score id in Power Bi table = 452

2020 total distinct count of score id in export csv = 483

2019 total distinct count of score id in Power Bi table = 266

2019 total distinct count of score id in export csv = 308

 

Can you please let me know if the DAX needs to be tweaked to get the records matching in Power Bi and export.

1 ACCEPTED SOLUTION

Accepted Solutions

@anee123 , because in CSV you are summing up count distinct and while power bi recalculate grand total .

 

This fomula is giving same result

2020 data = 
sumx(SUMMARIZE(Sheet1,Sheet1[Subjects],Sheet1[Institute], Sheet1[COURSE],"_1",CALCULATE(
	DISTINCTCOUNT(Sheet1[Score id]),
	'Sheet1'[Score_Year] IN { 2020 }
)),[_1])


Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

6 REPLIES 6
Super User IV
Super User IV

@anee123 , these formulas seem correct. Till Store Id, it will be a distinct count. Post that it will be a SUM.

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

@amitchandak are you able to access the links?

@anee123 , because in CSV you are summing up count distinct and while power bi recalculate grand total .

 

This fomula is giving same result

2020 data = 
sumx(SUMMARIZE(Sheet1,Sheet1[Subjects],Sheet1[Institute], Sheet1[COURSE],"_1",CALCULATE(
	DISTINCTCOUNT(Sheet1[Score id]),
	'Sheet1'[Score_Year] IN { 2020 }
)),[_1])


Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helper I
Helper I

@amitchandak  Thanks a lot, this worked. I was just curious as to why the previous DAX which i used for distinct count worked for all datasets except this dataset. Any particular reason that distinct count behaves differently with different datasets?

@amitchandak  The formula works, but the performance is impacted hugely, when we have too many slicers and when we do group by on each of the slicer values, the report rendering is too slow. Is ther any alternate work around to improve the performance here?

Helpful resources

Announcements
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors