Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
joshua1990
Post Prodigy
Post Prodigy

Calculated Column with COUNTROWS, Wildcard and in Multi Level Relationship

Hello community!

I have 3 table that are related to each other, always 1:n. The structure is like:

Table 1

Order Nr (Key) Text Text
1    
2    
3    

 

Table 2

Order Nr (Key) Order Nr Level 2 (Key) Text
1 123 dfg
1 1273 asd
2 2352 dsf

 

Table 3 

Order Nr Level 2 (Key) Text 1 Text 2
123 OK_ 1
123 NOK_ 1
1273 OK_ 1

 

Now I would like to add a calulcated column into talble 1 that counts how many rows are in Table 3, for the individual Order with the string "OK_"

Order Nr (Key) Text Text Result Column
1     2
2     0
3     0

 

 

How would you do that?

3 REPLIES 3
tamerj1
Super User
Super User

Hi @joshua1990 

please try

COUNTROWS (

FILTER ( CALCULATETABLE ( Table3 ), Table3[Text1] = "OK_" ) )

tamerj1
Super User
Super User

Hi @joshua1990 

are the tables connected?

@tamerj1 : Yes, the tables are connected via the keys that are highlighted in the column header above

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.