Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi
Is there a way to convert this query for the service? It works well on the Desktop version but not in the service
declare @From date
declare @to date
SELECT t1.*,t2.*,t3.*
FROM Fact f
Cross apply
(
select top 1
from dimension1 d1
where f.id=d1.id
and datefrom >=@From and dateto <=@To
order by datefrom desc) t1
outer apply
(select top 1
from dimension2 d2
where f.id2=d2.id
and datefrom >=@From and dateto <=@To
order by datefrom desc) t2
outer apply
(select top 1
from dimension2 d2
where f.id3=d2.id
and datefrom >=@From and dateto <=@To
order by datefrom desc) t3
As I understand it you only need it for table valued functions. CTEs are convenience constructs for subqueries, and joins work (mostly) the same way as applies.
I don't understand your response, I need to convert the query above to powerbi, there are other ways of doing apply type functions, but neither work with power bi in the format of the query.
I don't see any functions. You should be able to do the same with a standard left join.
These are table expressions being joined, so PBI needs to dynamically filter the apply expressions at run time for top 1's. It's not the same as a LEFT JOIN to a table
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.