Forum Discussion
Column or Measure based on value from Child Table
- 5 years ago
Hi, the solution might be different regarding on how you want to show this data. First of all the tables must be related to make thie following DAX work. I think the easiest to understand the model would be a new column in Parent table like this:
ColumnDoctor = COUNTX( FILTER( RELATEDTABLE(Children), Children[EducationalBackgroud] = "Doctor" ), Children[ID] )That will count the doctors in children for each row in parent. Then you can filter by > 0 to get the rows or add an IF like
ColumnDoctor= VAR previousCalulation = COUNTX(... RETURN IF ( previousCalculation > 0, TRUE(), FALSE() )You can also solve this with a measure, but I would prefer to know a bit more about the data visualization for this to understand the context before suggesting it.
Hope this helps,
Hi, the solution might be different regarding on how you want to show this data. First of all the tables must be related to make thie following DAX work. I think the easiest to understand the model would be a new column in Parent table like this:
ColumnDoctor =
COUNTX(
FILTER(
RELATEDTABLE(Children), Children[EducationalBackgroud] = "Doctor"
),
Children[ID]
)
That will count the doctors in children for each row in parent. Then you can filter by > 0 to get the rows or add an IF like
ColumnDoctor=
VAR previousCalulation = COUNTX(...
RETURN
IF ( previousCalculation > 0, TRUE(), FALSE() )
You can also solve this with a measure, but I would prefer to know a bit more about the data visualization for this to understand the context before suggesting it.
Hope this helps,