Forum Discussion
SQL OUTER APPLY - DAX equivalent?
I will need to convert a SQL statement that takes a base dataset and OUTER APPLYs it to a Date table, to cause the right-side query (Date) to execute once per result in the left-side query (base dataset). The reason I will need this is to allocate a portion of the time between issuestartdate and resolutiondate of every Alert raised for application outage to it's own row, so that I can flag the application as either up/down at the minute level. This I will use to build a historical trending with line chart/or bar graph visualization that shows what portion of a day (1440 minutes) an application was up and when it was down.
Is OUTER APPLY supported?
8 Replies
- vanessafvgCommunity Champion
in dax relationships you can create a variety of relationships
https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/
as well as power query there are a variety of join methods
http://radacad.com/how-to-change-joining-types-in-power-bi-and-power-query
- hxkreslAdvocate III
yes, i googled this question before posting. both articles are two years old, so uncertainty remains about outer apply.
- vanessafvgCommunity Champion
hxkresl have you attempted anything? outer apply being an outer join. in power query the article see below
even if the articles are 2 years old the technology hasn't changed that drastically, ie. im unclear what you are looking for? why dont you post your sql statement
from the power query article
- vanessafvgCommunity Champion
also there is this guided learning to help you get going
- hxkreslAdvocate III
i will review the articles and thanks for the guidance. I think you are saying to use power query for broad sweeps at shaping the data. Perhaps that is what i need to think about as well. At any rate I will review and come back with DDL with actual SQL if I don't make headway.
- hxkreslAdvocate III
I read the material links. Doesn't look like OUTER APPLY is supported....worried.
Would you mind looking at the problem in http://community.powerbi.com/t5/Developer/DAX-equiv-needed-Historical-Trending-of-application-outages/m-p/187356
different issue but with same dataset is here:
http://community.powerbi.com/t5/Desktop/Need-date-sorting-on-bar-graph/m-p/187584#M82502
Can I do this historical trending with DAX? Is there an alternative to OUTER APPLY? Or just forget SQL, can this be done in DAX?