Forum Discussion
Aggregate measure stopped working after USERELATIONSHIP feature added
morning dax
Thanks for getting back to me
I am trying to plot a cost value against time as a line chart. However I want the costs to aggregate over time to show the trend of spend.
I made a measure to do this aggregation which worked great.
Hi Matt22365 ,
If you want to show two tables' value in the same visual, I think you could create relationship on date table or other column which exist in two tables. Then based date column create measure. By the way, I don't know your data structure and expected output, so if possible, could you please inform me your sample datas(you could use virtual data instead of real data)? Then I will try to test this in my enviornment.
Please do mask sensitive data before uploading.
Thanks for your understanding and support.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Matt223656 years ago
Resolver III
Good morning dax
I cannot link to a data set but i have made a simplifed table below which represents the key columns in my table - Tasks & Baselines
Task Name TaskFixedCost TaskFinishDate TaskBaselineFinishDate Task 1 £ 1,000.00 03/01/2020 12/11/2019 Task 2 £ 500.00 15/04/2020 05/02/2020 Task 3 £ - 18/05/2020 16/02/2020 Task 4 £ 2,000.00 01/08/2020 03/06/2020 Task 5 £ 5,000.00 09/09/2020 01/08/2020 Task 6 £ 10,000.00 11/12/2020 10/09/2020 What I would like to do is plot a running total of my TaskFixedCost in a linechart where 1 line represents the TaskFinishDate and 1 line represents my TaskBaselineFinishDate.
simple version from excel here:
The measure I created -
Running Total baseline = CALCULATE(SUM('Tasks & Baselines'[TaskFixedCost]),FILTER(ALLSELECTED('Tasks & Baselines'),'Tasks & Baselines'[TaskBaselines.TaskBaselineFinishDate] <=MAX('Tasks & Baselines'[TaskBaselines.TaskBaselineFinishDate])))works great if I only want 1 of the 2 lines on the graphto get the 2nd line I was recommended to make a date table ("Timeset" in my calculation) and use 2 inactive relationships to link TaskFinish and TaskBaselineFinish to this date table. When I add in a USERELATIONSHIP step into the above measure the running total aspect stops working and i get a graph of just the TaskFixedCost individual lines rather than the running totalThis is the new measure (example is only for baseline):Running Total baseline = CALCULATE(SUM('Tasks & Baselines'[TaskFixedCost]),USERELATIONSHIP(TimeSet[TimeByDay],'Tasks & Baselines'[TaskBaselines.TaskBaselineFinishDate]), FILTER(ALLSELECTED('Tasks & Baselines'),'Tasks & Baselines'[TaskBaselines.TaskBaselineFinishDate] <=MAX('Tasks & Baselines'[TaskBaselines.TaskBaselineFinishDate])))This is my relationshipAny help would be greatly appreciatedThanksMatt- Matt223656 years ago
Resolver III
Hi dax
It seems that the issue is the type of connection between the 2 tables. If I simplify the data so I can have a 1:1 relationship the formula works, however my actual data is more complex so I need a many:1 relationship which causes it to stop working
Is there a way to fix this issue?
Thanks
Matt