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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
reynaldo_malave
Helper III
Helper III

join a virtual table with an imported table

Hi Guys, 

 

Thanks all that take the time to answer questions on the community. 

 

Here is my problem I created a virtual table ( 'forecasttable') that contains a forecast for the current month. I want to create a relationship between this table and my calendar. I have tried both join functions but it doesnt find the joining columns. 

 

Here is the working code that returns the total forecasted amount.

 

VAR forecasttable=

	ADDCOLUMNS(
		uniondatesandgroups, 
		"forecast", 
			IF( [Date] <= lastdate,
				[$ Total],
				[dailyforecast]
			)
	)

var forecast =

    SUMX( forecasttable, [forecast] )

RETURN

   forecast 

 

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

What you have there is a measure which returns a scalar value. The virtual table is only relevant to the calculation and is not a physical table in the model. So you can't create relationships. 
You need to create a new physical table using the code you have for the virtual table in a new table (under "Modeling" in the ribbon).





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

4 REPLIES 4
PaulDBrown
Community Champion
Community Champion

What you have there is a measure which returns a scalar value. The virtual table is only relevant to the calculation and is not a physical table in the model. So you can't create relationships. 
You need to create a new physical table using the code you have for the virtual table in a new table (under "Modeling" in the ribbon).





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thanks @PaulDBrown, this is the answer I was looking for. I did create a calculated table but its fixed table, so no slicing and dicing since it only returns totals. 

VahidDM
Super User
Super User

Hi @reynaldo_malave 

 

Please see this link and share more details about your question here to be able to work on it.

https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-Get-Your-Question-Answered-Quickly/m-p...

 

Appreciate your Kudos!

 

PaulDBrown
Community Champion
Community Champion

Can you share a sample PBIX file through OneDrive, Google Drive, Dropbox....?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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