cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

Distinctcount ALL

Why not working this measure?

 

m_CountOfCompanies = CALCULATE(DISTINCTCOUNTNOBLANK(_op[Company]),ALL(_op[Company]))
m_CountOfClients = CALCULATE(DISTINCTCOUNTNOBLANK(_op[Clients]),ALL(_op[Clients]))
 
I have to matrix in first i want to show Client Name | m_CountOfCompanies
in second i want to show Company Name | m_CountOfClients
 
so it working good only if nothing selected, if i select first company name in other matriz i see all this company clients but under each client column everyon client have 1 but i need to count all each clients companies count
1 ACCEPTED SOLUTION
Community Support
Community Support

Hi @Analitika ,

 

Based on my test, you just need to modify "ALL(_op[Clients])" to "ALL(_op)".

m_CountOfCompanies = CALCULATE(DISTINCTCOUNTNOBLANK(_op[Company]),ALL(_op))

m_CountOfClients = CALCULATE(DISTINCTCOUNTNOBLANK(_op[Clients]),ALL(_op))

3.PNG2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

3 REPLIES 3
Community Support
Community Support

Hi @Analitika ,

 

Based on my test, you just need to modify "ALL(_op[Clients])" to "ALL(_op)".

m_CountOfCompanies = CALCULATE(DISTINCTCOUNTNOBLANK(_op[Company]),ALL(_op))

m_CountOfClients = CALCULATE(DISTINCTCOUNTNOBLANK(_op[Clients]),ALL(_op))

3.PNG2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

Super User III
Super User III

Hi, @Analitika , pls keep in mind that filters propogate along with relationships, if any, among tables in the data model.

 

m_CountOfClients =
CALCULATE ( DISTINCTCOUNTNOBLANK ( _op[Clients] ), ALL ( _op[Clients] ) )

 

Even if filters on _op[Clients] were removed by ALL(), filters from other matrix on other columns in table _op remain effective; which in turn affect the calculation of DISTINCTCOUNTNOBLANK().

Super User IV
Super User IV

@Analitika , 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!

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors