Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi community experts, I have two tables, T1 and T2 with a relatinship one-to-many. Something like this
Table 1
ID | Attribute |
1 | 0.5 |
2 | 1 |
3 | 1 |
4 | 0.8 |
5 | 0.8 |
Table 2
ID | Field2 |
1 | |
1 | |
1 | |
3 | |
3 | |
5 | |
5 |
Now, my relationship is based on the ID field. I also have a measure that sums the Attribute in Table 1.
How can I use this measure saying something like: Calculate(sum(Table1[Attribute]); Table2[ID] = blank()) which does not work.
I'd like to calculate that measures, to see how much the sum would be for the records that do not have any correspondent in Table2.
Any idea?
Solved! Go to Solution.
Hi @Anonymous ,
You can use expect function to compare and extract nonexistent records from two tables:
Measure = VAR _list = EXCEPT ( VALUES ( Table1[ID] ), VALUES ( Table2[ID] ) ) RETURN CALCULATE ( SUM ( Table[Attribute] ), FILTER ( ALLSELECTED ( Table1 ), [ID] IN _list ) )
Regards,
Xiaoxin Sheng
Hi @Anonymous ,
You can use expect function to compare and extract nonexistent records from two tables:
Measure = VAR _list = EXCEPT ( VALUES ( Table1[ID] ), VALUES ( Table2[ID] ) ) RETURN CALCULATE ( SUM ( Table[Attribute] ), FILTER ( ALLSELECTED ( Table1 ), [ID] IN _list ) )
Regards,
Xiaoxin Sheng
Thanks, it helps!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
68 | |
53 | |
53 | |
36 | |
34 |
User | Count |
---|---|
84 | |
71 | |
55 | |
45 | |
43 |