<?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 Build fact tables from RDBMS table in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Build-fact-tables-from-RDBMS-table/m-p/1869924#M19497</link>
    <description>&lt;P&gt;I want to let my Power BI sit on top of our SSAS in which we are designing cubes with facts and dimension.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Base is an OLTP DB where we are going to extract all the data with the SSIS and then create facts and dimensions. In this case I have a registration table which looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;TD&gt;date_reg_start&lt;/TD&gt;&lt;TD&gt;process1_type&lt;/TD&gt;&lt;TD&gt;date_finished_process1&lt;/TD&gt;&lt;TD&gt;process2_type&lt;/TD&gt;&lt;TD&gt;date_finished_process2&lt;/TD&gt;&lt;TD&gt;date_reg_finished&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;25-05-2021&lt;/TD&gt;&lt;TD&gt;type1&lt;/TD&gt;&lt;TD&gt;25-05-2021&lt;/TD&gt;&lt;TD&gt;type1&lt;/TD&gt;&lt;TD&gt;28-05-2021&lt;/TD&gt;&lt;TD&gt;28-05-2021&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;26-05-2021&lt;/TD&gt;&lt;TD&gt;type23&lt;/TD&gt;&lt;TD&gt;28-05-2021&lt;/TD&gt;&lt;TD&gt;type9&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;27-05-2021&lt;/TD&gt;&lt;TD&gt;type1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;27-05-2021&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If someone start the registration the date_reg_start is set in the OLTP table. After that, if the user starts a type of process1 the type1 is set. If he finishes it, the date is set in the same row. the same procedure with process2. If process2 got completed, the registration_finish date will be set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, how will be look like the fact tables based on this oltp-registration table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 May 2021 12:05:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-05-28T12:05:31Z</dc:date>
    <item>
      <title>Build fact tables from RDBMS table</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Build-fact-tables-from-RDBMS-table/m-p/1869924#M19497</link>
      <description>&lt;P&gt;I want to let my Power BI sit on top of our SSAS in which we are designing cubes with facts and dimension.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Base is an OLTP DB where we are going to extract all the data with the SSIS and then create facts and dimensions. In this case I have a registration table which looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;TD&gt;date_reg_start&lt;/TD&gt;&lt;TD&gt;process1_type&lt;/TD&gt;&lt;TD&gt;date_finished_process1&lt;/TD&gt;&lt;TD&gt;process2_type&lt;/TD&gt;&lt;TD&gt;date_finished_process2&lt;/TD&gt;&lt;TD&gt;date_reg_finished&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;25-05-2021&lt;/TD&gt;&lt;TD&gt;type1&lt;/TD&gt;&lt;TD&gt;25-05-2021&lt;/TD&gt;&lt;TD&gt;type1&lt;/TD&gt;&lt;TD&gt;28-05-2021&lt;/TD&gt;&lt;TD&gt;28-05-2021&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;26-05-2021&lt;/TD&gt;&lt;TD&gt;type23&lt;/TD&gt;&lt;TD&gt;28-05-2021&lt;/TD&gt;&lt;TD&gt;type9&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;27-05-2021&lt;/TD&gt;&lt;TD&gt;type1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;27-05-2021&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If someone start the registration the date_reg_start is set in the OLTP table. After that, if the user starts a type of process1 the type1 is set. If he finishes it, the date is set in the same row. the same procedure with process2. If process2 got completed, the registration_finish date will be set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, how will be look like the fact tables based on this oltp-registration table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 12:05:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Build-fact-tables-from-RDBMS-table/m-p/1869924#M19497</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-28T12:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Build fact tables from RDBMS table</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Build-fact-tables-from-RDBMS-table/m-p/1872048#M19514</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on my understanding, you can transform your data like below first:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTIy1TUw1TUyMAJxSioLUnELWiAJInFidaKVjEBCZmiajIzRdYFELYG0AhiDNIKVmGOxTQEFg5SaoCtVwFQWCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [id = _t, date_reg_start = _t, process1_type = _t, date_finished_process1 = _t, process2_type = _t, date_finished_process2 = _t, date_reg_finished = _t]),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {"id", "date_reg_start", "date_finished_process1", "date_finished_process2", "date_reg_finished"}, "Attribute", "Value"),
    #"Unpivoted Columns1" = Table.UnpivotOtherColumns(#"Unpivoted Columns", {"id", "date_reg_start", "date_reg_finished", "Attribute", "Value"}, "Attribute.1", "Value.1"),
    #"Replaced Value" = Table.ReplaceValue(#"Unpivoted Columns1","_type","",Replacer.ReplaceText,{"Attribute"}),
    #"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","date_finished_","",Replacer.ReplaceText,{"Attribute.1"}),
    #"Added Conditional Column" = Table.AddColumn(#"Replaced Value1", "Custom", each if [Attribute] = [Attribute.1] then 1 else null),
    #"Filtered Rows" = Table.SelectRows(#"Added Conditional Column", each ([Custom] = 1)),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Custom", "Attribute.1"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Attribute", "process"}, {"Value", "type"}, {"Value.1", "date_finished"}}),
    #"Changed Type with Locale" = Table.TransformColumnTypes(#"Renamed Columns", {{"date_reg_start", type date}, {"date_reg_finished", type date}, {"date_finished", type date}}, "en-GB"),
    #"Changed Type" = Table.TransformColumnTypes(#"Changed Type with Locale",{{"id", Int64.Type}, {"date_reg_start", type date}, {"date_reg_finished", type date}, {"process", type text}, {"type", type text}, {"date_finished", type date}}),
    #"Reordered Columns" = Table.ReorderColumns(#"Changed Type",{"id", "date_reg_start", "process", "type", "date_finished", "date_reg_finished"})
in
    #"Reordered Columns"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Then, you can create a Date&amp;nbsp;dimension table and process, process type dimension table according to your requirements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this is not what you want, please share me more details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Icey&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 31 May 2021 05:42:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Build-fact-tables-from-RDBMS-table/m-p/1872048#M19514</guid>
      <dc:creator>Icey</dc:creator>
      <dc:date>2021-05-31T05:42:44Z</dc:date>
    </item>
  </channel>
</rss>

