<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert SQL Query with Variables to DAX Query in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/925715#M9338</link>
    <description>&lt;P&gt;I've updated my original post with what I've tried so far. Could someone please help me from here at least?&lt;/P&gt;</description>
    <pubDate>Fri, 07 Feb 2020 18:11:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-07T18:11:09Z</dc:date>
    <item>
      <title>Convert SQL Query with Variables to DAX Query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/924469#M9265</link>
      <description>&lt;P&gt;Could someone please help me in converting this working SQL Query to a DAX Query?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT [ProductNumber],
       CASE
           WHEN @StartDate BETWEEN [StartDate] AND [EndDate] THEN @StartDate
           WHEN @StartDate &amp;lt; [StartDate] THEN [StartDate]
       END AS [StartDate],
       CASE
           WHEN @EndDate BETWEEN [StartDate] AND [EndDate] THEN @EndDate
           WHEN @EndDate &amp;gt; [EndDate] THEN [EndDate]
       END AS [EndDate], 
       [PromoCode], 
       [DaysAvailableInWeek]
FROM [#Promos]
WHERE [StartDate] &amp;lt;= @EndDate
  AND [EndDate]   &amp;gt;= @StartDate
ORDER BY 1;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DDL:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="kwd"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;TABLE&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[#&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;Promos&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;([&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;ProductNumber&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;]&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;       INT&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; 
 &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;StartDate&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;]&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;           DATE&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; 
 &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;EndDate&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;]&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;             DATE&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; 
 &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;PromoCode&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;]&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;           VARCHAR&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;6&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;),&lt;/SPAN&gt; 
 &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;DaysAvailableInWeek&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;]&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; VARCHAR&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;20&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;DML:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="kwd"&gt;INSERT&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;INTO&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[#&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;Promos&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;]&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;([&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;ProductNumber&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;],&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;StartDate&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;],&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;EndDate&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;],&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;PromoCode&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;],&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;DaysAvailableInWeek&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;])&lt;/SPAN&gt;
&lt;SPAN class="kwd"&gt;VALUES&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;6512&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'2020-01-11'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'2020-01-13'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'ABC123'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'1, 3, 5'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;);&lt;/SPAN&gt;
&lt;SPAN class="kwd"&gt;INSERT&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;INTO&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[#&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;Promos&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;]&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;([&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;ProductNumber&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;],&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;StartDate&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;],&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;EndDate&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;],&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;PromoCode&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;],&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;DaysAvailableInWeek&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;])&lt;/SPAN&gt;
&lt;SPAN class="kwd"&gt;VALUES&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;6514&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'2020-01-12'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'2020-01-14'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'ABC123'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'4, 6'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;);&lt;/SPAN&gt;
&lt;SPAN class="kwd"&gt;INSERT&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;INTO&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[#&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;Promos&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;]&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;([&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;ProductNumber&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;],&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;StartDate&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;],&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;EndDate&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;],&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;PromoCode&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;],&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;DaysAvailableInWeek&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;])&lt;/SPAN&gt;
&lt;SPAN class="kwd"&gt;VALUES&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;2341&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'2020-01-11'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'2020-01-25'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'321XYZ'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'1, 2'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Here is what I tried so far, but it doesn't return correct results.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EVALUATE SUMMARIZECOLUMNS(
'Dim_Promos'[PromoCode], 
'Dim_Product'[ProductNumber], 
'Dim_Date_Start'[FullDate], 
'Dim_Date_End'[FullDate], 
FILTER('Dim_Date_Start', 'Dim_Date_Start'[FullDate] &amp;lt;= DATE(2020, 01, 15) ), 
FILTER('Dim_Date_End', 'Dim_Date_End'[FullDate] &amp;gt;= DATE(2019, 04, 11) ),
"Days Available In Week", [Days Available In Week])&lt;/LI-CODE&gt;&lt;P&gt;Also, I would need the date formatted as YYYY-MM-DD. When I tried the FORMAT function, it is throwing syntax error.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FORMAT('Dim_Date_Start'[FullDate], "YYYY-MM-DD"), 
FORMAT('Dim_Date_End'[FullDate], "YYYY-MM-DD")&lt;/LI-CODE&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 18:10:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/924469#M9265</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-07T18:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SQL Query with Variables to DAX Query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/924568#M9271</link>
      <description>&lt;P&gt;Help us out please.&lt;/P&gt;&lt;P&gt;Can you provide some sample data (not a picture) please?&lt;/P&gt;&lt;P&gt;Also, how do you assign the two variables (from the data by row or passed from slicers)?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 00:00:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/924568#M9271</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2020-02-07T00:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SQL Query with Variables to DAX Query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/924627#M9274</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="81111" data-lia-user-login="HotChilli" class="lia-mention lia-mention-user"&gt;HotChilli&lt;/a&gt;&amp;nbsp; I've updated my post with some sample data I'm using. I'm trying to call the DAX Query from SSRS Report/Power BI where I pass the Start and End dates to filter the data I need. Let me know if you need any other information to help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 01:16:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/924627#M9274</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-07T01:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SQL Query with Variables to DAX Query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/924650#M9275</link>
      <description>First load you table in power bi. If you are using directquery just connect it to database.&lt;BR /&gt;Then create one custom date table in power bi which is not linked with any other table.&lt;BR /&gt;&lt;BR /&gt;Calender function is there to create date table.&lt;BR /&gt;&lt;BR /&gt;I assume you are using between slicer for start data and end date.&lt;BR /&gt;&lt;BR /&gt;Add date column from date table into slicer.&lt;BR /&gt;&lt;BR /&gt;Note as you mention&lt;BR /&gt;You want columns dynamic so it is not possible because columns get loaded at first load only and they can not updated with slicers.&lt;BR /&gt;&lt;BR /&gt;So create measure&lt;BR /&gt;Startdate= if(max(table[startdate]) &amp;lt;= min(date[date])&amp;amp;&amp;amp; max(table[Enddate])&amp;gt;= min(date[date]),max(table[startdate]),if(min(date[date])&amp;lt;=max(table[startdate]),max(table[startdate])&lt;BR /&gt;&lt;BR /&gt;Similarly create one more meausre for end date.&lt;BR /&gt;Just you need to replace min(date[date]) with max(date[date]) and startdate with enddate column.&lt;BR /&gt;&lt;BR /&gt;For where clause create one conditional flag.&lt;BR /&gt;&lt;BR /&gt;Flag=If(max(table[startdate]) &amp;lt; max(date[date]) &amp;amp;&amp;amp; max(table[enddate]) &amp;gt; min(date[date]),1,0)&lt;BR /&gt;&lt;BR /&gt;Add this measure to visual level filter and set it to 1.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Pravin&lt;BR /&gt;&lt;BR /&gt;If it resolves your problem mark it as a solution and give Kudos.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 07 Feb 2020 01:50:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/924650#M9275</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-07T01:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SQL Query with Variables to DAX Query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/925681#M9336</link>
      <description>&lt;P&gt;I am not getting an option to create a new data table when connected to my source database. That's greyed out.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 07 Feb 2020 17:29:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/925681#M9336</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-07T17:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SQL Query with Variables to DAX Query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/925715#M9338</link>
      <description>&lt;P&gt;I've updated my original post with what I've tried so far. Could someone please help me from here at least?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 18:11:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/925715#M9338</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-07T18:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SQL Query with Variables to DAX Query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/925729#M9341</link>
      <description>I think you are using live connection.&lt;BR /&gt;&lt;BR /&gt;Create date table in your tabular model only.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Pravin</description>
      <pubDate>Fri, 07 Feb 2020 18:34:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/925729#M9341</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-07T18:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SQL Query with Variables to DAX Query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/925750#M9346</link>
      <description>&lt;P&gt;I don't think I have privileges to create in Tabular Model. Is it not possible without that? I've written most of query in DAX except that I am struggling with the filters as mentioned in my SQL example. Would you be able to help at least with that part please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 18:58:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/925750#M9346</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-07T18:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SQL Query with Variables to DAX Query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/925916#M9369</link>
      <description>Any how you need date dimension.&lt;BR /&gt;Ask tabular model creator to create this data dimension for you in model and tell him to do not link it with any other table.&lt;BR /&gt;&lt;BR /&gt;Then you can access it from power bi side and follow steps which i have already mentioned.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Pravin</description>
      <pubDate>Sat, 08 Feb 2020 02:20:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/925916#M9369</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-08T02:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SQL Query with Variables to DAX Query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/925932#M9373</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;, I am not sure if you've seen my last post. I've updated my original post with the DAX Query I've built so far which already includes a Date Dimension. I am not an expert in DAX and would like someone to help me with convert my working SQL Query into a complete DAX Query (which I've already built partially).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 08 Feb 2020 03:59:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/925932#M9373</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-08T03:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SQL Query with Variables to DAX Query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/930256#M9527</link>
      <description>&lt;P&gt;No one to help me?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 14:34:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/930256#M9527</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-12T14:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SQL Query with Variables to DAX Query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/930390#M9531</link>
      <description>&lt;P&gt;I think the original question has been made more complicated by the additional tables.&amp;nbsp; So i'll try and give a form for the DAX (you can develop it for your needs).&lt;/P&gt;&lt;P&gt;I simplified the logic in the original SQL case statements (because if there are two options and it's not one it must be the other)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EVALUATE
VAR _startDate = DATE(2020,01,14)
VAR _endDate = DATE(2020,01,11)
            
RETURN
    SELECTCOLUMNS(FILTER(Promos, Promos[StartDate] &amp;lt;= _enddate &amp;amp;&amp;amp; Promos[EndDate] &amp;gt;= _startdate ),
          "ProductNumber", Promos[ProductNumber], 
          "StartDate", IF (_startDate &amp;lt; Promos[StartDate], Promos[StartDate], _startDate),
          "EndDate", IF (_endDate &amp;gt; Promos[EndDate], Promos[EndDate], _endDate),
          "PromoCode", Promos[PromoCode],
          "DaysAvailable", Promos[DaysAvailableInWeek] )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 15:39:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/930390#M9531</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2020-02-12T15:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SQL Query with Variables to DAX Query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/930479#M9536</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="81111" data-lia-user-login="HotChilli" class="lia-mention lia-mention-user"&gt;HotChilli&lt;/a&gt;&amp;nbsp;, thanks for posting the query. Since it is a Star Schema, I have multiple tables - One Fact and Many Dimensions. So, if I specify only one table, it doesn't let me add other tables and that is where I am seeking the Community help as I am fairly new to DAX world. Any help with that would be highly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 16:21:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-SQL-Query-with-Variables-to-DAX-Query/m-p/930479#M9536</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-12T16:21:18Z</dc:date>
    </item>
  </channel>
</rss>

