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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Analitika
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
v-jayw-msft
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
v-jayw-msft
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.
CNENFRNL
Community Champion
Community Champion

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().


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

amitchandak
Super User
Super User

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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