<?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: Sum selected columns based on lookup of column names in other table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4332800#M172014</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="900885" data-lia-user-login="AndersKa" class="lia-mention lia-mention-user"&gt;AndersKa&lt;/a&gt;&amp;nbsp;- This measure creates a table which sums all of the Days at the issue key level and then uses it as a basis for find the ones under 100 days.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not included any status filtering, but that can be done by wrapping the summarize in a CALCULATETABLE and using the filter section to adjust the status' you need:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR _table =
    SUMMARIZE ( 'Table', 'Table'[key], "@totaldays", SUM ( 'Table'[days] ) )
VAR _less_than_100 =
    COUNTROWS ( FILTER ( _table, [@totaldays] &amp;lt; 100 ) )
VAR _total =
    DISTINCTCOUNT ( 'Table'[key] )
RETURN
    DIVIDE ( _less_than_100, _total )&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 17 Dec 2024 10:07:41 GMT</pubDate>
    <dc:creator>mark_endicott</dc:creator>
    <dc:date>2024-12-17T10:07:41Z</dc:date>
    <item>
      <title>Sum selected columns based on lookup of column names in other table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4328242#M171820</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am hoping someone can help me with summing selected columns based on a lookup of column names in another table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1 "Lead Time" contains jira issues and their respective "times in status" in a number of different columns, looks like this:&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;Now I want to create a calculated column (or a measure) that sum a selected number of columns.&lt;/P&gt;&lt;P&gt;The challenge is I would like to do it using a lookup in another table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2 "Status Mapping" below. So I'd like to create a Backlog column/measure in Table 1 that dynamically sum up the four columns that I have set as the Backlog kanban status below.&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;Is that possible? Many thanks for your help in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 15:46:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4328242#M171820</guid>
      <dc:creator>AndersKa</dc:creator>
      <dc:date>2024-12-13T15:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sum selected columns based on lookup of column names in other table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4328251#M171821</link>
      <description>&lt;P&gt;Unpivot the columns so that you are left with the issue ID and any other columns you need plus a status type column and the time in that status. You can then link your status mapping table to the status type column.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 15:53:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4328251#M171821</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2024-12-13T15:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sum selected columns based on lookup of column names in other table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4328408#M171828</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="900885" data-lia-user-login="AndersKa" class="lia-mention lia-mention-user"&gt;AndersKa&lt;/a&gt;&amp;nbsp;-&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240987" data-lia-user-login="johnt75" class="lia-mention lia-mention-user"&gt;johnt75&lt;/a&gt;'s approach is correct.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a blog of mine on why it makes things easier and is better for performance:&amp;nbsp;&lt;A href="https://triangle.im/power-bi-mistake-5-why-pivoted-data-leads-to-power-bi-pain/" target="_blank"&gt;https://triangle.im/power-bi-mistake-5-why-pivoted-data-leads-to-power-bi-pain/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here's some guidance on how to do it:&amp;nbsp;&lt;A href="https://youtu.be/li0c6R6UpCw?si=cS381Negdvm50cpp&amp;amp;t=92" target="_blank"&gt;https://youtu.be/li0c6R6UpCw?si=cS381Negdvm50cpp&amp;amp;t=92&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 17:19:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4328408#M171828</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-12-13T17:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sum selected columns based on lookup of column names in other table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4332740#M172008</link>
      <description>&lt;P&gt;Thank you both for your support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With your advice I managed to go upstream and unpivot the columns at the source. So now that I got "normalized" data I stumbled into another challenge. Hmm... I suspect there is a fairly easy solution but my DAX skills aren't up to it yet. If you have the time I would love your input on this too.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I want to create a percentage of issues with a lead time of less than 100 days. With my pivoted data this was quite easy but now I struggle.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;With my new unpivoted datasets I now select "work in process" kanban statuses Analysis+Backlog+Implementing&lt;/LI&gt;&lt;LI&gt;This in turn includes all potential issue-statuses I have mapped to these 3 kanban statuses&lt;/LI&gt;&lt;LI&gt;Which in turn give me all unpivoted lines&lt;/LI&gt;&lt;LI&gt;Now I'd like to distinctly count the number of issues (keys) with days summing up to less than 100 ...&lt;/LI&gt;&lt;LI&gt;... and divide by total number of issues (keys) ...&lt;/LI&gt;&lt;LI&gt;... to produce a percentage of issues done in less than 100 days&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 09:41:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4332740#M172008</guid>
      <dc:creator>AndersKa</dc:creator>
      <dc:date>2024-12-17T09:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sum selected columns based on lookup of column names in other table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4332779#M172013</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Less than 100 days % =
VAR WorkInProgress =
    ADDCOLUMNS (
        DISTINCT ( 'Table'[Key] ),
        "@hours",
            CALCULATE (
                SUM ( 'Table'[Days] ),
                KEEPFILTERS ( 'Table'[Kanban status] IN { "Analysis", "Backlog", "Implementing" } )
            )
    )
VAR TotalKeys =
    CALCULATE ( DISTINCTCOUNT ( 'Table'[Key] ), REMOVEFILTERS () )
VAR Result =
    DIVIDE ( WorkInProgress, TotalKeys )
RETURN
    Result
&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 17 Dec 2024 09:58:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4332779#M172013</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2024-12-17T09:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sum selected columns based on lookup of column names in other table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4332800#M172014</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="900885" data-lia-user-login="AndersKa" class="lia-mention lia-mention-user"&gt;AndersKa&lt;/a&gt;&amp;nbsp;- This measure creates a table which sums all of the Days at the issue key level and then uses it as a basis for find the ones under 100 days.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not included any status filtering, but that can be done by wrapping the summarize in a CALCULATETABLE and using the filter section to adjust the status' you need:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR _table =
    SUMMARIZE ( 'Table', 'Table'[key], "@totaldays", SUM ( 'Table'[days] ) )
VAR _less_than_100 =
    COUNTROWS ( FILTER ( _table, [@totaldays] &amp;lt; 100 ) )
VAR _total =
    DISTINCTCOUNT ( 'Table'[key] )
RETURN
    DIVIDE ( _less_than_100, _total )&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 17 Dec 2024 10:07:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4332800#M172014</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-12-17T10:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sum selected columns based on lookup of column names in other table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4333212#M172039</link>
      <description>&lt;P&gt;That is brilliant, works a charm. Thank you kindly.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 14:06:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-selected-columns-based-on-lookup-of-column-names-in-other/m-p/4333212#M172039</guid>
      <dc:creator>AndersKa</dc:creator>
      <dc:date>2024-12-17T14:06:08Z</dc:date>
    </item>
  </channel>
</rss>

