Forum Discussion
Data Relationships
- Anonymous5 years ago
HiRG010,
You can try measure like this to meet your needs:
Measure =var a=CALCULATE(SUM('Table B'[Target]),FILTER(ALL('Table B'),'Table B'[Target Year]=MAX('Table A'[Start Year])&&'Table B'[Location Name]=MAX('Table A'[Location Name])))ReturnIF(a=BLANK(),"",a)Here is the demo ,please try it :Hope it helps.
Best Regards,
Caitlyn YanIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
I suggest you change the relationship to one-to-many (from the target table to the data table). When building visuals you then use the fields from the target table (which will filter the data table) and add any further fields you may need from the data table. Any aggregations on numerical values or counts of text rows etc on both tables will then work seamlessly.
Thanks for the suggestion PaulDBrown . However, due to some requirements in my original dataset, I can't use the Target year (from Target Table) as columns. I need to use the Start Year(from Data table) in the matrix. Implementing your suggestion to convert relationship from One -to - many still gave me the similar result as the screenshot in my original post. Any other suggestion would be really helpful. Thanks.