<?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: Calculated Day Factor in Report Builder in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Calculated-Day-Factor-in-Report-Builder/m-p/4325222#M38913</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Report Builder uses VB.NET-based expressions. You'll need to use the functions available in Report Builder to implement similar calculations.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CurrentDate=Max(Fields!TapeDate.Value)

DaysInMonth=DateDiff("d", DateAdd("m", 1, DateSerial(Year(Fields!TapeDate.Value), Month(Fields!TapeDate.Value), 1)), DateSerial(Year(Fields!TapeDate.Value), Month(Fields!TapeDate.Value), 1))

DaysInYear=DateDiff("d", DateSerial(Year(Fields!TapeDate.Value), 1, 1), DateSerial(Year(Fields!TapeDate.Value), 12, 31)) + 1

AdjustmentFactor =DaysInYear / DaysInMonth

The final=IIf(Sum(Fields!AvgBook.Value) = 0, 0, (Sum(Fields!CLC_Withdrawal.Value) / Sum(Fields!AvgBook.Value)) * AdjustmentFactor)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;You can create a calculated field or use these expressions directly in a report item (e.g., text box, table).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A title="https://community.powerbi.com/t5/community-blog/how-to-get-your-question-answered-quickly/ba-p/38490" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C02%7Cv-yohua%40microsoft.com%7Ce1106bfabecb4734a5cc08dc2305bc51%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638423754744679080%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=24%2BceC5sFd3n3%2FhFDYILWFcNjCwVClBD%2BPBsSLVfJGk%3D&amp;amp;reserved=0" target="_blank" rel="noopener nofollow noreferrer"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yongkang Hua&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Dec 2024 06:52:59 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-12-12T06:52:59Z</dc:date>
    <item>
      <title>Calculated Day Factor in Report Builder</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Calculated-Day-Factor-in-Report-Builder/m-p/4324382#M38907</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I currently have a Calculated Measure in a PBI Desktop report that I'm trying to replicate in a different report that's in "MS Report Builder".&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;ClcFtpRtTd =&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;VAR CurrentDate = MAX('TimeDeposits'[TapeDate]) &lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;VAR DaysInMonth = DAY(EOMONTH(CurrentDate, 0)) &lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;VAR DaysInYear = YEARFRAC(DATE(YEAR(CurrentDate), 1, 1), DATE(YEAR(CurrentDate), 12, 31)) * 365&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;VAR AdjustmentFactor = &amp;nbsp;DaysInYear / DaysInMonth&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;RETURN IFERROR((SUM('TimeDeposits'[CLC_Withdrawal]) / SUM('TimeDeposits'[AvgBook])) * AdjustmentFactor, 0) &amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;How do I go about replicating/translating the calculated measure from PBI Desktop to a MS Report Builder report?&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Dec 2024 17:37:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Calculated-Day-Factor-in-Report-Builder/m-p/4324382#M38907</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-11T17:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Day Factor in Report Builder</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Calculated-Day-Factor-in-Report-Builder/m-p/4325222#M38913</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Report Builder uses VB.NET-based expressions. You'll need to use the functions available in Report Builder to implement similar calculations.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CurrentDate=Max(Fields!TapeDate.Value)

DaysInMonth=DateDiff("d", DateAdd("m", 1, DateSerial(Year(Fields!TapeDate.Value), Month(Fields!TapeDate.Value), 1)), DateSerial(Year(Fields!TapeDate.Value), Month(Fields!TapeDate.Value), 1))

DaysInYear=DateDiff("d", DateSerial(Year(Fields!TapeDate.Value), 1, 1), DateSerial(Year(Fields!TapeDate.Value), 12, 31)) + 1

AdjustmentFactor =DaysInYear / DaysInMonth

The final=IIf(Sum(Fields!AvgBook.Value) = 0, 0, (Sum(Fields!CLC_Withdrawal.Value) / Sum(Fields!AvgBook.Value)) * AdjustmentFactor)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;You can create a calculated field or use these expressions directly in a report item (e.g., text box, table).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A title="https://community.powerbi.com/t5/community-blog/how-to-get-your-question-answered-quickly/ba-p/38490" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C02%7Cv-yohua%40microsoft.com%7Ce1106bfabecb4734a5cc08dc2305bc51%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638423754744679080%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=24%2BceC5sFd3n3%2FhFDYILWFcNjCwVClBD%2BPBsSLVfJGk%3D&amp;amp;reserved=0" target="_blank" rel="noopener nofollow noreferrer"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yongkang Hua&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 06:52:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Calculated-Day-Factor-in-Report-Builder/m-p/4325222#M38913</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-12T06:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Day Factor in Report Builder</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Calculated-Day-Factor-in-Report-Builder/m-p/4326432#M38917</link>
      <description>&lt;P&gt;Brilliant!&amp;nbsp; I'm not sure I would've ever figured that out on my own, thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 16:42:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Calculated-Day-Factor-in-Report-Builder/m-p/4326432#M38917</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-12T16:42:39Z</dc:date>
    </item>
  </channel>
</rss>

