Forum Discussion
USERELATIONSHIP not working on many to 1
- 6 years ago
Hi Matt22365 ,
To calculate the accumulated value, the table in the filter should be table2 not table1:
Running Total Start = CALCULATE ( SUM ( 'Table1'[Value] ), USERELATIONSHIP ( Table2[Date], 'Table1'[Start Date] ), FILTER ( ALL ( 'Table2'), 'Table2'[Date] <= MAX('Table2'[Date]) ) ) Running Total End = CALCULATE ( SUM ( 'Table1'[Value] ), USERELATIONSHIP ( Table2[Date], 'Table1'[End Date] ), FILTER( ALL(Table2), 'Table2'[Date] <= MAX('Table2'[Date]) ) )Attached the sample file that hopes to help you: USERELATIONSHIP not working on many to 1.pbix
Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- 6 years ago
Hi
Thank you very much that worked great. I could not open your example file but the formula update worked.
I has made it so the measure doesnt accumulate in a table visualisation but I can live with that, the trend line was my main priority
Matt
Hi Matt22365 ,
To calculate the accumulated value, the table in the filter should be table2 not table1:
Running Total Start =
CALCULATE (
SUM ( 'Table1'[Value] ),
USERELATIONSHIP ( Table2[Date], 'Table1'[Start Date] ),
FILTER (
ALL ( 'Table2'),
'Table2'[Date] <= MAX('Table2'[Date])
)
)
Running Total End =
CALCULATE (
SUM ( 'Table1'[Value] ),
USERELATIONSHIP ( Table2[Date], 'Table1'[End Date] ),
FILTER(
ALL(Table2),
'Table2'[Date] <= MAX('Table2'[Date])
)
)Attached the sample file that hopes to help you: USERELATIONSHIP not working on many to 1.pbix
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi
Thank you very much that worked great. I could not open your example file but the formula update worked.
I has made it so the measure doesnt accumulate in a table visualisation but I can live with that, the trend line was my main priority
Matt