<?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: Unpivoting table Power Query and DAX code in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3771042#M147293</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the code above works in so far as it creates the new table with resource and capacity by work ref as you stated- thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some follow up queries:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. The pbix file I provided was the table structure I have, but was a based on a copy of the SharePoint list source with had dummy names in to ensure it was anonymised data. When I run your code on my actual data, I get the names Jim, Gus etc which are not the actual names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I get the code to work on my actual source data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. How do remove the resource name and capacity columns from the Work Tracker table. and unpivot it?&lt;/P&gt;&lt;P&gt;3. WIll the previous code you provided in 'worked.pbix' work given the data is now split into two tables? If not, what code do I need to do the calcualtion, inclduing removing any non-working days based on the dimDates table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;</description>
    <pubDate>Mon, 18 Mar 2024 09:46:12 GMT</pubDate>
    <dc:creator>SteveMForm</dc:creator>
    <dc:date>2024-03-18T09:46:12Z</dc:date>
    <item>
      <title>Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3763993#M146885</link>
      <description>&lt;P&gt;Hi Folks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;reaching back out to&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You sweated for me on this one a little while ago:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-Staff-Capacity-against-Work-by-Month/m-p/3680133/highlight/true#M142899" target="_blank" rel="noopener"&gt;Solved: How to show Staff Capacity against Work by Month - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I add your query and select 'done' it comes up with the table in the 'worked.pbix' you attached to previous post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm just trying to implement now and have got a bit stuck, first issue was the power query didn't work for my source:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Expression.Error: Invalid binary encoding.
Details:
    1a5b9214-7320-41c8-afcb-9660c825e049&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I replaced this part of your query highlighted in red:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("&lt;FONT color="#FF0000"&gt;jdNbb4IwGAbgv9JwresBEL01cUvMku1uF8aLTj5ZM6BLW5b579eC5WjExNAPYngfXsrhELBwSUhIg0XwIdU3ckMGBmlTnc8olSXYCwxTghlhoZ0pjt0Y2fFZQWqXtzzjdiFPiT2+g1HNGbPHPS9At2e3f8eFRzCPYFdEIRUMJRRTdkOyBWUG4Unf5W63lZ/1HM47otg73J8VLFPZIJomqM8PCSaJF+xUKaAhgKqTol5qNOmio9K7lpW3uFvAHy9ECUiBrnKjxx6KSdcIv4KGsfM1jAGJB7hWUqFPldY9gAtd9wTNRnGCFyV/6ypeq7xqQ3e5keXMjhgT1p7gytDCIFneE7BJB11oPGjk8RY2npBMvg/EMy7KMYTilWfsRVFcmrV98EEnDxFi4gmujtOXEtoUXKMfrsxlUoPdmtHoM/Wvnvbjo7n44z8=&lt;/FONT&gt;", BinaryEncoding.Base64),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with what I thought was the source taken from previous queries on the data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;= Source{[Id="&lt;FONT color="#FF0000"&gt;1a5b9214-7320-41c8-afcb-9660c825e049&lt;/FONT&gt;"]}[Items]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thats when I got the expression error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please can I get some help with this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had 2 follow up queries that I'll ask at the same time now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. The slimmed down table I gave in the previous post and which the 'worked.pbix' was generated from- my actual table in the report is bigger- do I need to alter the query to ensure all relevant columns are unpivotted? I have attached a skeleton PBI file which has all the columns in so you can see them- any steer on this welcome)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. You recommended filtering the DAX outputs you had written "&lt;SPAN&gt;Next step would be to filter a or b with NETWORKDAYS".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- for a month, or a week, I would need to divide by net working days, but if I needed to check on a single given day, this 'month' logic would not be needed, I am thinking.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- how would the DAX be extended to handle this? I have included the dimdates table in the attached pbix file as well.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks - and let me know if you are on buy me a coffee or equivilant&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Mar 2024 20:38:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3763993#M146885</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-03-16T20:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3763997#M146887</link>
      <description>&lt;P&gt;can't work out how to attach a .pbix- anyone help?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 15:42:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3763997#M146887</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-03-14T15:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3764020#M146888</link>
      <description>&lt;P&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 15:55:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3764020#M146888</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-14T15:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3764234#M146900</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;- link as follows, hope it works:&amp;nbsp;&lt;STRONG&gt;&lt;A title="Original URL: https://drive.google.com/file/d/1dojJ7pQ56akvamBumsHtMFlBjuUCKbv_. Click or tap if you trust this link." href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1dojJ7pQ56akvamBumsHtMFlBjuUCKbv_&amp;amp;data=05%7C02%7Cjoe.mellor%40hmrc.gov.uk%7C9554b2f79e554f1c1c6a08dc4450bbc2%7Cac52f73cfd1a4a9a8e7a4a248f3139e1%7C0%7C0%7C638460360730994147%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=Vp9sLaXhagk9GtE3pDQdj9HSfcNKeQX9E0JJu7Yh5UI%3D&amp;amp;reserved=0" target="_blank" rel="noopener noreferrer"&gt;https://drive.google.com/file/d/1dojJ7pQ56akvamBumsHtMFlBjuUCKbv_&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 18:02:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3764234#M146900</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-03-14T18:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3768728#M147169</link>
      <description>&lt;P&gt;The link says I need to ask for access.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Mar 2024 12:58:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3768728#M147169</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-16T12:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3769017#M147182</link>
      <description>&lt;P&gt;should be sorted now&lt;/P&gt;</description>
      <pubDate>Sat, 16 Mar 2024 20:35:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3769017#M147182</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-03-16T20:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3769031#M147185</link>
      <description>&lt;P&gt;You have work items without any resources.&amp;nbsp; How should these be presented?&amp;nbsp; If you want the resources to be unpivoted you have to have data in at least one of them.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Mar 2024 20:47:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3769031#M147185</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-16T20:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3769067#M147192</link>
      <description>&lt;P&gt;hi there&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp; well- in reality - we will have some work items we log that are &lt;EM&gt;potential&amp;nbsp;&amp;nbsp;&lt;/EM&gt;work that will happen, and so wont hold a resource against them at that point in time, but may allocate a resource at a later date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I need this presented- well, they wont feature in a capacity view, or will have a 'nil' effect, but we would need to be able to allocate resource at a future time and the code to pick up and slot into the capacity report&lt;/P&gt;</description>
      <pubDate>Sat, 16 Mar 2024 21:55:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3769067#M147192</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-03-16T21:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3769081#M147196</link>
      <description>&lt;P&gt;I would recommend you use separate tables.&amp;nbsp; One for the projects and the other for the assigned resources.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Mar 2024 23:21:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3769081#M147196</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-16T23:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3769235#M147208</link>
      <description>&lt;P&gt;I was just thinking it may be a limiting factor if I understand how you are approaching unpivoting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, to confirm, what data are are you suggesting is in each table, and is the creation of the separate tables in Power BI, not at source?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the moment, all items are held in one SharePoint list in the data source, and preference would be to keep it that way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to split the data in Power BI, creating the two tables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Mar 2024 09:08:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3769235#M147208</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-03-17T09:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3769618#M147227</link>
      <description>&lt;P&gt;You can keep your SharePoint list&amp;nbsp; (and I would recommend you connect to it directly)&amp;nbsp; but in Power Query I would split it such that the Work Tracker table only has the work item columns (remove all the resource columns)&amp;nbsp; and the newly created Resources table only has the Work item ID column and the resource columns.&amp;nbsp; You can the unpivot that Resources table to make it usable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("pVbLboMwEPwXn1NkG/zgW6ocUBOlqYIa5XFIvr7BhrVxScATCSEsMeP17Ox6Pz+ZLD84LwVbMV7Yx7vZbB/v+We9GrDSYc3jvbue87CVWvR/itJuR0k78kJQ5LzgHell3y4gMtD2FkLVFLSPLf5exKC4Q1XRUYMEyxh8muWcQNNgiRxblRCqglCQm5RGUJpDKAGhIOU1pLyGlNeQ8hpTHipaDRWtrhGUgbxhIG8YyBsG8oaBvGEgbxjIGwbyhoG8YSBvWN+CRXe8TXPPBMsAzu7ftnwHXAXwcXvJHBGseufQ/raHZhNrCAtEbdkwWuTrld72Gdg6DGNeLB9D2xy+FlNItnw8SLHlG6FXFG7+vlCfqKE+UUN9ovZJDZMuLzqtemfFQ+hrIsE5Gzsrlsx/n6/32wIiQYDcuhI85Cq7NgT3RekGyd8TS8fx7vtn37Y3Eqk/T7+4XJvThf48fu8PtGib0y7aJySKFwtSHYCWGIdhuWLJ6O0Cn+NBurwQgs467C5SrUaKPMmAI6w6QkUKDIQ65ghnexGZI8p2vkNl35AOVZPDXmk9iZUcxypLmlCdquciT2WQ15ZEpvruCPsuPH8tBAf5Xmxn/p/GlgHbW8eypOPEHSTU3L+6opobp0impBnRiewp0m3p+07nw+F6G9l6NlOBKUwGA1MZC6IiA7jFk6a6Xv8B", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Work Tracker_Work Ref" = _t, #"Work Tracker_Resource 1 Capacity" = _t, #"Work Tracker_Resource 1 Name" = _t, #"Work Tracker_Resource 2 Capacity" = _t, #"Work Tracker_Resource 2 name" = _t, #"Work Tracker_Resource 3 Capacity" = _t, #"Work Tracker_Resource 3 name" = _t, #"Work Tracker_Resource 4 Capacity" = _t, #"Work Tracker_Resource 4 name" = _t, #"Work Tracker_Resource 5 Capacity" = _t, #"Work Tracker_Resource 5 name" = _t, #"Work Tracker_Resource 6 Capacity" = _t, #"Work Tracker_Resource 6 name" = _t, #"Work Tracker_Resource 7 Capacity" = _t, #"Work Tracker_Resource 7 name" = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Work Tracker_Work Ref"}, "Attribute", "Value"),
    #"Replaced Value" = Table.ReplaceValue(#"Unpivoted Other Columns","Work Tracker_Resource ","",Replacer.ReplaceText,{"Attribute"}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Replaced Value", "Attribute", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, false), {"Attribute.1", "Attribute.2"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Work Tracker_Work Ref", type text}, {"Attribute.1", Int64.Type}, {"Attribute.2", type text}}),
    #"Capitalized Each Word" = Table.TransformColumns(#"Changed Type",{{"Attribute.2", Text.Proper, type text}}),
    #"Pivoted Column" = Table.Pivot(#"Capitalized Each Word", List.Distinct(#"Capitalized Each Word"[Attribute.2]), "Attribute.2", "Value"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Pivoted Column",{{"Capacity", type number}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type1", each ([Capacity] &amp;lt;&amp;gt; null)),
    #"Renamed Columns" = Table.RenameColumns(#"Filtered Rows",{{"Attribute.1", "Resource"}})
in
    #"Renamed Columns"&lt;/LI-CODE&gt;
&lt;P&gt;How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done". Once you examined the code, replace the Source step with your own source.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Mar 2024 21:42:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3769618#M147227</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-17T21:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3771042#M147293</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the code above works in so far as it creates the new table with resource and capacity by work ref as you stated- thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some follow up queries:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. The pbix file I provided was the table structure I have, but was a based on a copy of the SharePoint list source with had dummy names in to ensure it was anonymised data. When I run your code on my actual data, I get the names Jim, Gus etc which are not the actual names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I get the code to work on my actual source data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. How do remove the resource name and capacity columns from the Work Tracker table. and unpivot it?&lt;/P&gt;&lt;P&gt;3. WIll the previous code you provided in 'worked.pbix' work given the data is now split into two tables? If not, what code do I need to do the calcualtion, inclduing removing any non-working days based on the dimDates table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 09:46:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3771042#M147293</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-03-18T09:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3776152#M147585</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;- any ideas on this yet?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 19:02:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3776152#M147585</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-03-19T19:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3779672#M147683</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;/Folks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is anyone able to help further with this one?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 13:46:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3779672#M147683</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-03-20T13:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3783001#M147769</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="684418" data-lia-user-login="SteveMForm" class="lia-mention lia-mention-user"&gt;SteveMForm&lt;/a&gt;&amp;nbsp;Responding to your private message. Coming into this super late. The names of people are actually in what looks like an enter data query. This is in the Source step. You need to replace that Source step with the actual source, like your SharePoint list. If the list has the same structure, column names, etc then everything will work just fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have no idea about question 2. If you are referring to the table that you end up with, you can just remove those 2 columns. What are you unpivoting?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. No idea, came into this late so not sure what this is referring to.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 12:42:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3783001#M147769</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-03-21T12:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3783300#M147773</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;- thanks for giving some input on this&lt;BR /&gt;&lt;BR /&gt;On replacing the source step, novices like me just need a little bit more direction: so if we take the query above, I need to know what actual text I need to replace- is it just between the "", do I need the Json.Document and Binary encoding stuff?&lt;BR /&gt;&lt;BR /&gt;Need to also check where I am getting the source ID from is correct. I have this in the query window under 'Source':&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;= SharePoint.Tables("https://xxx.sharepoint.com/teams/GRP034774924", [Implementation="2.0", ViewMode="All"])

&lt;/LI-CODE&gt;&lt;P&gt;and this under 'Navigation' (which I assume is the specific list ID):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;= Source{[Id="1a5b9214-7320-41c8-afcb-9660c825e049"]}[Items]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. The suggestion has been to split the Work Tracker table in order to pivot both this and the new table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Work Traker is basically: each Work Item = a SharePoint Item in the list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A whole bunch of values are captured against each Work Item, including who is resourced on it and what capacity for each person (up to 7 resources on any Work Item).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I split off the Resource Name and Capacity Columns from by Work Tracker table into a new table, the advice is to delete the same columns in the Work Tracker table they were split from:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume this does not cause any issues, and if I delete these columns from Work Tracker, whenever I need to refresh the data, it will update across the split tables correctly? I also didn't know if I needed to create any table relationships between the two split tables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. You'll need to see the previous post as the the measure that was suggested as solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It very helpfully suggested the dax to create a measure based on a dummy table and data I provided, and was provided in a .pbix file- 'worked':&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Worked = 
var a = SUMMARIZECOLUMNS('work tracker'[Name],'work tracker'[Start Date],'work tracker'[End Date],'work tracker'[Capacity],'Calendar'[Date])
var b = ADDCOLUMNS(a,"sm",if([Start Date]&amp;lt;=[Date] &amp;amp;&amp;amp; [Date]&amp;lt;=[End Date],[Capacity]))
return sumx(b,[sm])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now having provided the actual table structures in the file link in this post (albeit with alot of values stripped out and names anonymised)&amp;nbsp; (&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;A title="Original URL: https://drive.google.com/file/d/1dojJ7pQ56akvamBumsHtMFlBjuUCKbv_. Click or tap if you trust this link." href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1dojJ7pQ56akvamBumsHtMFlBjuUCKbv_&amp;amp;data=05%7C02%7Cjoe.mellor%40hmrc.gov.uk%7C9554b2f79e554f1c1c6a08dc4450bbc2%7Cac52f73cfd1a4a9a8e7a4a248f3139e1%7C0%7C0%7C638460360730994147%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=Vp9sLaXhagk9GtE3pDQdj9HSfcNKeQX9E0JJu7Yh5UI%3D&amp;amp;reserved=0" target="_blank" rel="noopener noreferrer nofollow"&gt;https://drive.google.com/file/d/1dojJ7pQ56akvamBumsHtMFlBjuUCKbv_&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;)&lt;/SPAN&gt;&lt;/STRONG&gt; but also now with the splitting of tables and removing columns etc, I am suspecting the previous measure won't work and needs updating.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal is to show capacity used in the team at any point in time (default to show by month) where capacity used is a sum at any single point in time of the resources on 'Work Items'- happy to explain further&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 18:09:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3783300#M147773</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-03-21T18:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3785367#M147859</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&amp;nbsp;@ Anyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would appreciate some help to get to the solution on this one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 08:19:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3785367#M147859</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-03-22T08:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3787450#M147948</link>
      <description>&lt;P&gt;Ok, so kinda disappointed in how this forum seems to run.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've supported users in different types of technology over the years and always took a vested interest in making sure they got the support they needed. Once you start being involved, see it through type approach, be responsive.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess I'll need to try and finish this one myself. Thanks for the input I did get.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2024 11:36:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3787450#M147948</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-03-23T11:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3787522#M147958</link>
      <description>&lt;P&gt;Fair points, but please keep in mind that this forum is where users help each other, time permitting, and to the best of their abilities. You changed the scope and complexity of your request quite a bit, to the point where it exceeded my abilities (as an example). Maybe start over with a simpler ask.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need this covered professionally you can engage with one of the Microsoft partners in your area.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2024 14:55:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3787522#M147958</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-23T14:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Unpivoting table Power Query and DAX code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3787584#M147963</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;thanks for your response and appreciate the reflection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the scope was always the same, ie the problem I was trying to solve, it just got more involved as it unpacked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The last query I had on what bit of the power query do I need to replace/ need still seems kinda basic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate others help time permitting, but when they don't respond but are online, I personnaly just need a - 'I don't know, it's beyond me' response. Obviously the limit of ability is a fair shout, and good to let people know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I might well look to engage a Microsoft partner and prob can through work although it will be protracted- I cant afford this personnaly if it costs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A simple ask now would be- what do I replace in this and the previous posts Power Query with my own source ID, and do I have the right data as my source ID (see message 15 here)&lt;BR /&gt;&lt;BR /&gt;At least I can do the pivots and split the tables then &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2024 17:16:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unpivoting-table-Power-Query-and-DAX-code/m-p/3787584#M147963</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-03-23T17:16:21Z</dc:date>
    </item>
  </channel>
</rss>

