title: How do i convert sumifs in excel to a PowerBI formula?
body: <p>I am trying to replicate the following excel formula in PowerBi. It adds all the refunded costs from a Unique identifier between a date period</p>
  
  <p>I have tried using the Sumx function in powerBi but It doesn't return the values i need it to return.</p>
  
  <pre><code>SUMIFS([@Refunded;
  [@Date];"&gt;="&amp;MAX([@Date])-42;
  [@Date];"&lt;="&amp;MAX([@Date])-14;
  [@UID];)
  </code></pre>
  
  <p>It needs to return the sum of the same unique identifiers between 42 and 14 days earlier.</p>
  
  <p>I have tried solving is as follows:</p>
  
  <pre><code>calculate(SUM([Refunded]),DATESBETWEEN(all_funnel_data_view[Date].[Date],Value(all_funnel_data_view[Date].[Date])=TODAY()-42,Value(all_funnel_data_view[Date].[Date])=TODAY()-14))
  </code></pre>
  
  <p>But is only returns empty field</p>