cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Highlighted
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,

2 REPLIES 2
Highlighted
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,

harakuruku Regular Visitor
Regular Visitor

Re: [Help] Count in DAX!

Thank you @v-sihou-msft~

Helpful resources

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.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 39 members 1,078 guests