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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Model Relationship is not working

Hi,

I have attached model and trying a simple dax but one is not invoking a relationship:

 

Capture.PNG

 

This dax invoke the relationship between Fact and Vendor but it is slow:

Count Jobs 1 =
CALCULATE(DISTINCTCOUNT(Fact[Job ID]), CONTAINSSTRING( Vendor[Vendor Name],"abc"),
FILTER(Fact, Fact[Quantity] >0 ))

 

but this one does not invoke between Fact and Vendor (it does not filter vendors that have 'abc' string in them)  but is faster as each line in Job table is unique:

Count Jobs 2 =
CALCULATE(COUNTROWS(Job), CONTAINSSTRING( Vendor[Vendor Name],"abc") ,
FILTER(Fact, fact[Quantity] >0 ))

 

How can I make the measure 'Count Job 2' use the filter CONTAINSSTRING( Vendor[Vendor Name],"abc")?

 

Thanks.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , as both dimensions are not related, that is why that might not work.

Try like

Count Jobs 2 =
CALCULATE(CALCULATE(COUNTROWS(Job),FILTER(Fact, fact[Quantity] >0 )) , CONTAINSSTRING( Vendor[Vendor Name],"abc") ,
)

 

or use the first one

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

perfect, it worked. thanks @amitchandak.

amitchandak
Super User
Super User

@Anonymous , as both dimensions are not related, that is why that might not work.

Try like

Count Jobs 2 =
CALCULATE(CALCULATE(COUNTROWS(Job),FILTER(Fact, fact[Quantity] >0 )) , CONTAINSSTRING( Vendor[Vendor Name],"abc") ,
)

 

or use the first one

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors