Forum Discussion

hxkresl's avatar
hxkresl
Advocate III
9 years ago

SQL OUTER APPLY - DAX equivalent needed.

I believe Power Query doesn't support OUTER APPLY and my requirement can't be solved any other way.  

 

Is anyone willing to look at the issue and confirm so that I know whether to post as suggestion in later PBI releases?

 

I have fully built out a demo of my use of OUTER APPLY.

 

My need of OUTER APPLY has come up a couple times in last 3 years and I see a need for it whenever needing to answer ON/OFF  trends for issues that go on for several days running.   Answers questions like: Was a backup running during this hour and for how many minutes?  Was there an outage during this hour? can not be created any other way but to pair the original dataset with a time table at Min or Hour grain.

 

pbix   https://www.dropbox.com/s/eetbedmowivujib/OUTERAPPLY.pbix?dl=0

 

DDL https://www.dropbox.com/s/reb977pjq0epffp/DDL.sql?dl=0

 

end result is a nice left to right scroll of trends.  In other cases it can be a heat map with conditional formatting.

 

2 Replies

  • Eric_Zhang's avatar
    Eric_Zhang
    Microsoft Employee

    hxkresl

    I'm not quite sure what you'd like. Do you want an equivalent result of the OUT APPLY SQL query in your pbix file? I mean you'd like to remove the OUT APPLY from the SQL query and want to implement the OUT APPLY in Power Query?

     

    If so, you may not need Power Query. You can import all tables and create proper relationship and implement the OUT APPLY with DAX measures.

     

    Please post more clarification.

     

    By the way, the time table involved in the OUT APPLY query is not included in the DDL uploaded.