Forum Discussion
91asma2
5 years agoHelper I
Distinct Count Two Measures
- Anonymous5 years ago
Here's what the measures should look like:
[Follow up] = COUNTROWS( FILTER( VALUES( Assessment[User ID] ), CALCULATE( DISTINCTCOUNT( Assessment[assessment_id] ) >= 2 ) ) ) [Total Users Training] = CALCULATE( DISTINCTCOUNT( 'Sessions'[User ID] ), KEEPFILTERS( 'Sessions'[Event Category] = "Training" ) ) [Users in Both] = var FollowUpUsers = FILTER( VALUES( Assessment[User ID] ), CALCULATE( DISTINCTCOUNT( Assessment[assessment_id] ) >= 2 ) ) var TotalUsersTrainingUsers = CALCULATETABLE( DISTINCT( 'Sessions'[User ID] ), KEEPFILTERS( 'Sessions'[Event Category] = "Training" ) ) var Result = COUNTROWS( INTERSECT( FollowUpUsers, TotalUsersTrainingUsers ) ) RETURN Result
Anonymous
5 years agoNot applicable
... which means your model is sub-optimal, to say the least. Your Users should exist in a dimensions of their own and be connected to both fact tables. Then it'll be DEAD EASY to do what you want. Please make your model correct first. If you want to know what it means you can read this:
Understand star schema and the importance for Power BI - Power BI | Microsoft Docs
91asma2
5 years agoHelper I
Thank you, the article is helpful. But my model is correct and I know it easy but I am not sure how to approach it. What is your recommendation?