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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
harakuruku
Helper I
Helper I

[Help] Count in DAX!

I have four tables. Table Agreement, Beaches, Connection and District.

Table Connection has a column AgreementID and BeachID.

Here is the relationship between the table:

Table Agreement &Table Connection through Agreement ID

Table Beaches & Table Connection through Beach ID

Table District & Table Beaches through District ID

 

Now, what I want to count is the number of Agreement ID per District. Sample data:
a.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Result should be like this:
b.PNG

 

Should I create a measure column or merge queries?

Thank you!!!

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@harakuruku

 

In this scenario, you already build the relationships between tables, then you just need to create measure like below: 

 

Number Of ID =
CALCULATE (
    COUNTA ( Agreement[AgreementID] ),
    ALLEXCEPT ( District, District[District] )
)

Regards,

View solution in original post

2 REPLIES 2
v-sihou-msft
Employee
Employee

@harakuruku

 

In this scenario, you already build the relationships between tables, then you just need to create measure like below: 

 

Number Of ID =
CALCULATE (
    COUNTA ( Agreement[AgreementID] ),
    ALLEXCEPT ( District, District[District] )
)

Regards,

Thank you @v-sihou-msft~

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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