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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
athuiraps
Frequent Visitor

it Possible to do Dax Calculations when we use two Direct Query Tables?

Is it Possible to do Dax Calculations when we use two Direct Query Tables?

I have two direct query data sources, am trying to create a calculated column using two fields from that.

While using the DAX function "RELATED" to I receive an error.

 

 DATEDIFF(RELATED('Quarter dates'[End Date]]),Effectivedatetable[EffectiveDate],DAY)+1

athuiraps_0-1627647099452.png

 

Both tables are in direct query mode.

Relationship: Quarter dates (one) has a relationship with Effectivedatetable (many) (This two tables are from two different data source.)

Cardinality = Many to One (*:1)

Cross filter direction = Both

Make this relationship active = Checked

4 REPLIES 4
v-luwang-msft
Community Support
Community Support

Hi @athuiraps ,

DAX is available, but there are certain time intelligence DAX features that you cannot use such as every year, month over month, same period, and last year. to learn more direct query limitations,you could  click here to read Official Article .

Also about the error you encountered, you must use RELATEDTABLE instead of related due to the relationship between Quarter dates  and Effectivedatetable  is one -> many. 

refer :https://community.powerbi.com/t5/Desktop/Using-RELATED/m-p/7994  

https://community.powerbi.com/t5/Desktop/Lookups-when-RELATED-doesn-t-work/m-p/1083795#M501870

 

 

Wish it is helpful for you!

 

Best Regards

Lucien

m3tr01d
Continued Contributor
Continued Contributor

@athuiraps This seem to be an issue with composite model and DirectQuery. It doesnt seem to have been solved yet.

https://community.powerbi.com/t5/Issues/DAX-function-quot-RELATED-quot-does-not-work-between-DirectQ...

m3tr01d
Continued Contributor
Continued Contributor

@athuiraps First, is there a reason why you are using Direct query instead of Import mode?

Ys, Becauue our datasource is a power bi service live connection model(powerbi dataset).

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.