The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Solved! Go to Solution.
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] ) )
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
@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
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
32 | |
15 | |
12 | |
12 | |
7 |