Forum Discussion
RG010
5 years agoFrequent Visitor
Data Relationships
Hi! So I have 2 tables which I have imported in PowerBI and created visualizations from. 1st table is Data table and Second table is Target table. A representative dataset is attached below. ...
- 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.
PaulDBrown
5 years agoCommunity Champion
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.