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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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