cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Row total count and grand total count is diffrent by using DistinctCount and Calculate in Matrix

I am actively looking for the solution to resolve the issue appeared several times in my Power BI report. So I have created the measure to calculate the distinct count of the users which are connected City/country-wise by using below DAX.

Total User Connected(Wireless) = CALCULATE( DISTINCTCOUNT('Posture assessment'['ENDPOINT_ID']),FILTER('Posture assessment','Posture assessment'[NAC Policy ]="Wireless"))

And my grand total and subtotal is completely wrong as compared to actual row count. Then I tried a different approach with this DAX below but no change. Total is still wrong.

Count of Unique = SUMX(Values('Posture assessment'[Region]),CALCULATE(DISTINCTCOUNT('Posture assessment'['ENDPOINT_ID']),FILTER('Posture assessment','Posture assessment'[NAC Policy ]="Wireless")))

Table illustration is: Here, for example, India's value is different as compared to the total.Capture.GIF

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IX
Super User IX

Re: Row total count and grand total count is diffrent by using DistinctCount and Calculate in Matrix

@Vashukla11 , Try to rollup from city level

Count of Unique = SUMX(summarize('Posture assessment','Posture assessment'[Region],'Posture assessment'[Country],'Posture assessment'[City],"_1",CALCULATE(DISTINCTCOUNT('Posture assessment'['ENDPOINT_ID']),FILTER('Posture assessment','Posture assessment'[NAC Policy ]="Wireless"))),[_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

2 REPLIES 2
Highlighted
Super User IX
Super User IX

Re: Row total count and grand total count is diffrent by using DistinctCount and Calculate in Matrix

@Vashukla11 , Try to rollup from city level

Count of Unique = SUMX(summarize('Posture assessment','Posture assessment'[Region],'Posture assessment'[Country],'Posture assessment'[City],"_1",CALCULATE(DISTINCTCOUNT('Posture assessment'['ENDPOINT_ID']),FILTER('Posture assessment','Posture assessment'[NAC Policy ]="Wireless"))),[_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

Highlighted
Frequent Visitor

Re: Row total count and grand total count is diffrent by using DistinctCount and Calculate in Matrix

Thanks for the quick help Amit, It is working. 

Just wanted to know why we are using "_1". Is this to calculate row or some kind of indexing. 

Please explain. 

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Don't miss the Power BI Dev Camp this week!

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Kudoed Authors