Forum Discussion
Counting Events That Happen in Two Tables for Same Data Table
- Anonymous7 years ago
Hi Anonymous ,
It seems like you want to calculate between two tables. I'd like to suggest you break cleandr table relationships and use formula to manually calculate correspond table count and do compare with them.
Measure = VAR selected = VALUES ( Date[Date] ) VAR _account = CALCULATETABLE ( VALUES ( Account[Alternate Account Number] ), FILTER ( ALLSELECTED ( Account ), [Date] IN selected ) ) VAR _patient = CALCULATETABLE ( VALUES ( VW_Patients[chart number] ), FILTER ( ALLSELECTED ( VW_Patients ), [Date] IN selected ) ) RETURN DIVIDE ( COUNTROWS ( INTERSECT ( _patient, _account ) ), COUNTROWS ( _account ) )Notice: create a table visual based on date dimension table year, month fields and above measure.
If above not help, can you please share some sample data for test, it is hard to coding formula without any sample data.(do mask on sensitive data)
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hi Anonymous ,
It seems like you want to calculate between two tables. I'd like to suggest you break cleandr table relationships and use formula to manually calculate correspond table count and do compare with them.
Measure =
VAR selected =
VALUES ( Date[Date] )
VAR _account =
CALCULATETABLE (
VALUES ( Account[Alternate Account Number] ),
FILTER ( ALLSELECTED ( Account ), [Date] IN selected )
)
VAR _patient =
CALCULATETABLE (
VALUES ( VW_Patients[chart number] ),
FILTER ( ALLSELECTED ( VW_Patients ), [Date] IN selected )
)
RETURN
DIVIDE (
COUNTROWS ( INTERSECT ( _patient, _account ) ),
COUNTROWS ( _account )
)
Notice: create a table visual based on date dimension table year, month fields and above measure.
If above not help, can you please share some sample data for test, it is hard to coding formula without any sample data.(do mask on sensitive data)
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng