Forum Discussion
DAX Creating Virtual table with columns computed from multiple fact tables
- 6 years ago
I think it would be best to create not a virtual but a physical table that combines the two tables you now have. It will save you a lot of problems and time, I believe.
If you do want to find the previous date in the virtual table, you can do something like
MAXX(FILTER(VirtualTable, [Date_] < currentdate_),[Date_])
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Hi razmochaev
Can you show the structure of the tables needed to generate the result table? And explain how exactly the information in the result table should be obtained?
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
I'll give a simplified table structured (originally they are in Russian :-)). The point is that I cannot append the in Power query.
The resulting table I am trying to create must contain, for each product ID and its sales dates, the date of previous sale for this product for a given date.
- AlB6 years ago
Community Champion
How about using UNION() to get a table that has all the rows of the other two (just like an append in M) and then work with that table
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
- razmochaev6 years ago
Helper I
But how can I compute the "Previous Sale Date" column of this virtual table. I cannot use CALCULATE(MAX(UnionTable[Sale date]),...) since I cannot use Virtual table's columns as a column reference...
- AlB6 years ago
Community Champion
I think it would be best to create not a virtual but a physical table that combines the two tables you now have. It will save you a lot of problems and time, I believe.
If you do want to find the previous date in the virtual table, you can do something like
MAXX(FILTER(VirtualTable, [Date_] < currentdate_),[Date_])
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers