Forum Discussion
ddpl
3 years agoSolution Sage
Two table common key and relationship issue...
Morning to all, I have 2 tables... Table 1 Client ID- Date------- Key_1 A 01-01-22 A | 01-01-22 B 01-05-22 B | 01-05-22 B 01-06-22 B | 01-06-22 C 01-16-22 C | 01-16-...
- Anonymous3 years ago
Hi ddpl ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create two measures as below:
Count(Table 1) = VAR _selclientid = SELECTEDVALUE ( 'Table1'[Client ID] ) VAR _count = CALCULATE ( COUNT ( 'Table1'[Date] ), FILTER ( ALLSELECTED ( 'Table1' ), 'Table1'[Client ID] = _selclientid ) ) RETURN _countCount(Table 2) = VAR _selclientid = SELECTEDVALUE ( 'Table1'[Client ID] ) VAR _count = CALCULATE ( COUNT ( 'Table2'[Date] ), FILTER ( ALLSELECTED ( 'Table2' ), 'Table2'[Client ID] = _selclientid ) ) RETURN _countBest Regards
Anonymous
3 years agoNot applicable
Hi ddpl ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create two measures as below:
Count(Table 1) =
VAR _selclientid =
SELECTEDVALUE ( 'Table1'[Client ID] )
VAR _count =
CALCULATE (
COUNT ( 'Table1'[Date] ),
FILTER ( ALLSELECTED ( 'Table1' ), 'Table1'[Client ID] = _selclientid )
)
RETURN
_countCount(Table 2) =
VAR _selclientid =
SELECTEDVALUE ( 'Table1'[Client ID] )
VAR _count =
CALCULATE (
COUNT ( 'Table2'[Date] ),
FILTER ( ALLSELECTED ( 'Table2' ), 'Table2'[Client ID] = _selclientid )
)
RETURN
_count
Best Regards