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
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
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
GregDeckler

How to Get Your Question Answered Quickly

Power BI Super User, Greg Deckler, explains

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Ideas
Users Online
Currently online: 42 members 937 guests
Please welcome our newest community members: