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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

measure to count

Hello,
There are three tables linked together in the model as follows:

Table1
--------
Key
EntityID

Table2
--------
EntityID

Table3
---------
TypeName
EntityID

At present, there is an active relationship between table1 and Table2 on EntityID
Table2 (1) --> (*) Table1 as 1 to many - single direction from Table2 to Table1
Table2(1) --> (*) Table3 as 1 to many - single direction from Table2 to Table3

What is the measure to show the count of rows in Key column for each of the TypeName
Example:

TypeName        Count
---------------------
A                       15
XMT                  12
...

Thnak you

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

you can use TREATAS for that
https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/

something like this

Measure =
CALCULATE (
    COUNTROWS ( 'Table1' ),
    TREATAS ( VALUES ( 'Table2'[EntityID] ), 'Table1'[EntityID] )
)


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

2 REPLIES 2
Stachu
Community Champion
Community Champion

you can use TREATAS for that
https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/

something like this

Measure =
CALCULATE (
    COUNTROWS ( 'Table1' ),
    TREATAS ( VALUES ( 'Table2'[EntityID] ), 'Table1'[EntityID] )
)


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

Thank you


@Stachu wrote:

you can use TREATAS for that
https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/

something like this

Measure =
CALCULATE (
    COUNTROWS ( 'Table1' ),
    TREATAS ( VALUES ( 'Table2'[EntityID] ), 'Table1'[EntityID] )
)

Thank you

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.