Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi guys,
I have two tables linked with an inactive relationship.
Table 1 "Required Files" is the One side with unique values, column name: "Register Code & Mth-Yr"
Tabe 2 "Submitted Files" is the Many side with column "Register Code & Run Date" which can be repeated or just not present when compared to table 1 (so we know the file is not yet submitted).
I want to count how many times a file is submitted in Table 2 and bring that information into a new column in Table 1.
If I had an active relationship, this would be a simple measure = COUNTROWS(Table 2)
Placing the measure inside Table 1 automatically causes table 2 to filter for each "Register Code & Month-Yr" and count only those rows.
How do I replicate the same with an inactive relationship?
I've tried to use USERELATIONSHIP, but I don't know where I'm going wrong.
Thanks in advance for your help!
Solved! Go to Solution.
 
					
				
		
Hi @DotU ,
Table 1 "Required Files"
Tabe 2 "Submitted Files"
Inacitve relationship
Now you could create a calculated column in "Required Files".
Column =
CALCULATE (
    COUNTROWS ( 'Submitted Files' ),
    FILTER (
        'Submitted Files',
        [Register Code & Run Date] = [Register Code & Mth-Yr]
    )
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
 
					
				
		
Hi @DotU ,
Table 1 "Required Files"
Tabe 2 "Submitted Files"
Inacitve relationship
Now you could create a calculated column in "Required Files".
Column =
CALCULATE (
    COUNTROWS ( 'Submitted Files' ),
    FILTER (
        'Submitted Files',
        [Register Code & Run Date] = [Register Code & Mth-Yr]
    )
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
What you provided works like a charm. Thank you ! For my work, I need to put additional filters on the Submitted Files table for:
File Purpose = "MPR"   and
File Type = "Threat"
This is how I modified the formula, it works, but I wanted to check with you if it is the best approach:
On another note,
The following is what I was able to do before I received your response:
Hi @DotU ,
About with and without the FILTER function in the CALCULATE function, you could refer to
powerbi - DAX Calculate function with and without FILTER - Stack Overflow
DAX Calculate function with and without FILTER
Which measure is better, this is difficult for me to answer, I can only say that both metrics are applicable. Because the performance of the measure also depends on many aspects.
You can go download DAX Studio to find out.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hi @DotU 
I see you have a dimension RequiredFiles and the column used for the relationship is Register Code & Mth.
Register Code & Mth : Is it some kind of concatenation of two fields?
What is the field used to define a RequiredFile?
Hi @m3tr01d ,
Thanks for the prompt response. Yes, I was concatenating two fields. And when I went into my file to send you some screen captures, I realized that in one table I concatenated using "-" while in the other I used " - ", and because of this any and all formuals I was trying were failing!
I'm surpised PowerBI even let me create a relationship if there were zero matches... hummm
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 88 | |
| 49 | |
| 37 | |
| 31 | |
| 30 |