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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ARU_
Advocate I
Advocate I

Related function not working with Values function

Hello Community members,


I am a newbie in DAX and trying out following DAX to create a temp table. 

temp_table = ADDCOLUMNS(VALUES(Sales[OrderDateKey]), "cal_date", RELATED('Date'[Date]),  "sales", [Sales Amount])
Somehow, the related function isnt working and it throws following error. I read the official microsoft documentation for both Related and Values function. I am not sure why it isnt working. 

ARU__0-1680529555430.png

 

As per the model, the Date table has a relationship with Sales table. Not sure why then, Related function isnt working. 

 

One can refer the pbix on which i am working to this link

 

https://drive.google.com/file/d/1a7E6ZCmFPciuYG3CDH8tzMQDPim3toLO/view?usp=share_link

 

Thank you so much for your time in trying to help here.

 

Cheers 

ARU

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Not 100% sure why RELATED doesn't work with ADDCOLUMNS, but you can achieve the same thing with

ADDCOLUMNS(
	SUMMARIZE( 'Sales', 'Sales'[OrderDateKey], 'Date'[Date] ),
	"sales", [Sales Amount]
)

When using SUMMARIZE you can group by any column from the expanded table.

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

Not 100% sure why RELATED doesn't work with ADDCOLUMNS, but you can achieve the same thing with

ADDCOLUMNS(
	SUMMARIZE( 'Sales', 'Sales'[OrderDateKey], 'Date'[Date] ),
	"sales", [Sales Amount]
)

When using SUMMARIZE you can group by any column from the expanded table.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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