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

[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

Accepted Solutions
Moderator v-sihou-msft
Moderator

Re: [Help] Count in DAX!

@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
Moderator v-sihou-msft
Moderator

Re: [Help] Count in DAX!

@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

harakuruku Regular Visitor
Regular Visitor

Re: [Help] Count in DAX!

Thank you @v-sihou-msft~

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 242 members 2,490 guests
Please welcome our newest community members: