Forum Discussion
Measure to create relationship between two columns
- 6 years ago
Hi Baker96 ,
I guess if you want a measure like the following:
Measure = VAR _table = VALUES ( Logs[Logged Date] ) RETURN CALCULATE ( COUNT ( Tasks[Task Id] ), FILTER ( ALL ( Tasks ), Tasks[Created Date] IN _table ) )Here is a demo, please try it:
Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Baker96 ,
Try the measure below:
Measure =
VAR mind =
MIN ( 'Date'[Date] )
VAR maxd =
MAX ( 'Date'[Date] )
RETURN
CALCULATE (
COUNT ( Tasks[Task Id] ),
FILTER (
ALL ( Tasks ),
'Tasks'[Created Date] >= mind
&& 'Tasks'[Created Date] <= maxd
)
)Here is a demo, please try it:
Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-joesh-msftThank you for your response, that works well except, my apologies, I missed out something in the logs table which results in the measure not working. The logs mostly likely has duplicate task ids, for example log task 2 on 02/10/2019 but also log again on 03/10/2019. This means there is a one to many relationship betweeen tasks and logs, respectively. This results in the measure not accurately counting, my best assumation it is only counting tasks which have logs in that time frame. (To test I added two extra rows in the logs table:
| Task Id | Logged Date |
| 2 | 03/10/2019 |
| 4 | 05/10/2019 |
- v-joesh-msft6 years agoSolution Sage
Hi Baker96 ,
I guess if you want a measure like the following:
Measure = VAR _table = VALUES ( Logs[Logged Date] ) RETURN CALCULATE ( COUNT ( Tasks[Task Id] ), FILTER ( ALL ( Tasks ), Tasks[Created Date] IN _table ) )Here is a demo, please try it:
Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.