<?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 % of Row Total DAX Measure Only Working Sometimes in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Row-Total-DAX-Measure-Only-Working-Sometimes/m-p/2804115#M88350</link>
    <description>&lt;P&gt;Hi There and thanks in advance for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to replicate the "Show value as % of Row Total" as a DAX measure. This is so I can perform column specific target number comparisons and thus add conditional formatting logic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As seen below, the TOP table is the end result I wish to have. The BOTTOM table are the source numbers.&lt;BR /&gt;"Emp Name (Group)" is the field for the rows, and "Mapping" is for the columns.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the formula I'm using:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Total Hrs]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Labour Detail'&lt;/SPAN&gt;&lt;SPAN&gt;[Mapping]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;Measure = CALCULATE([Total Hrs],ALL('Labour Detail'[Mapping])) &amp;lt; I've also tried this one and it doesn't work.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;and here's the result:&lt;BR /&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel like I'm really close. The weird part is that when I switch the measure over to use a different field called "Period", and swap out my columns in the matrix to period, it ends up working:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure 3 = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Total Hrs]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Labour Detail'&lt;/SPAN&gt;&lt;SPAN&gt;[Period]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;As you can see, the Measure 3 is giving me the total of the row.&lt;/P&gt;&lt;P&gt;Anyone have an idea as to why this DAX measure seems to only work with my "Period" field but not my "Mapping" field?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Sep 2022 20:44:16 GMT</pubDate>
    <dc:creator>GarlonYau</dc:creator>
    <dc:date>2022-09-28T20:44:16Z</dc:date>
    <item>
      <title>% of Row Total DAX Measure Only Working Sometimes</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Row-Total-DAX-Measure-Only-Working-Sometimes/m-p/2804115#M88350</link>
      <description>&lt;P&gt;Hi There and thanks in advance for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to replicate the "Show value as % of Row Total" as a DAX measure. This is so I can perform column specific target number comparisons and thus add conditional formatting logic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As seen below, the TOP table is the end result I wish to have. The BOTTOM table are the source numbers.&lt;BR /&gt;"Emp Name (Group)" is the field for the rows, and "Mapping" is for the columns.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the formula I'm using:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Total Hrs]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Labour Detail'&lt;/SPAN&gt;&lt;SPAN&gt;[Mapping]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;Measure = CALCULATE([Total Hrs],ALL('Labour Detail'[Mapping])) &amp;lt; I've also tried this one and it doesn't work.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;and here's the result:&lt;BR /&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel like I'm really close. The weird part is that when I switch the measure over to use a different field called "Period", and swap out my columns in the matrix to period, it ends up working:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure 3 = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Total Hrs]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Labour Detail'&lt;/SPAN&gt;&lt;SPAN&gt;[Period]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;As you can see, the Measure 3 is giving me the total of the row.&lt;/P&gt;&lt;P&gt;Anyone have an idea as to why this DAX measure seems to only work with my "Period" field but not my "Mapping" field?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 20:44:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Row-Total-DAX-Measure-Only-Working-Sometimes/m-p/2804115#M88350</guid>
      <dc:creator>GarlonYau</dc:creator>
      <dc:date>2022-09-28T20:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: % of Row Total DAX Measure Only Working Sometimes</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Row-Total-DAX-Measure-Only-Working-Sometimes/m-p/2805041#M88423</link>
      <description>&lt;P&gt;Any ideas or suggestions on this would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 06:30:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Row-Total-DAX-Measure-Only-Working-Sometimes/m-p/2805041#M88423</guid>
      <dc:creator>GarlonYau</dc:creator>
      <dc:date>2022-09-29T06:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: % of Row Total DAX Measure Only Working Sometimes</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Row-Total-DAX-Measure-Only-Working-Sometimes/m-p/2806075#M88503</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="162930" data-lia-user-login="GarlonYau" class="lia-mention lia-mention-user"&gt;GarlonYau&lt;/a&gt;&amp;nbsp;，&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you tell me what’s your 'Labour Detail' table? According to your description, here is my solution.&lt;/P&gt;
&lt;P&gt;Create a column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
'Table'[SALES] + 'Table'[SALES-P#] + 'Table'[MANAGEMENT] + 'Table'[ADMINISTRATION] + 'Table'[R&amp;amp;D] + 'Table'[TECHNICAL] + 'Table'[SAFETY] + 'Table'[CHARGEABLE]&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Create measures.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
DIVIDE ( MAX ( 'Table'[SALES] ), MAX ( 'Table'[Column] ) )

Measure2 =
DIVIDE ( MAX ( 'Table'[SALES-P#] ), MAX ( 'Table'[Column] ) )

Measure3 =
DIVIDE ( MAX ( 'Table'[MANAGEMENT] ), MAX ( 'Table'[Column] ) )

Measure4 =
DIVIDE ( MAX ( 'Table'[ADMINISTRATION] ), MAX ( 'Table'[Column] ) )

Measure5 =
DIVIDE ( MAX ( 'Table'[R&amp;amp;D] ), MAX ( 'Table'[Column] ) )

Measure6 =
DIVIDE ( MAX ( 'Table'[TECHNICAL] ), MAX ( 'Table'[Column] ) )

Measure7 =
DIVIDE ( MAX ( 'Table'[SAFETY] ), MAX ( 'Table'[Column] ) )

Measure8 =
DIVIDE ( MAX ( 'Table'[CHARGEABLE] ), MAX ( 'Table'[Column] ) )
 
Measure9 =
DIVIDE ( MAX ( 'Table'[Column] ), MAX ( 'Table'[Column] ) )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I attach my sample below for your reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ xiaosun&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps,&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 10:39:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Row-Total-DAX-Measure-Only-Working-Sometimes/m-p/2806075#M88503</guid>
      <dc:creator>v-xiaosun-msft</dc:creator>
      <dc:date>2022-09-29T10:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: % of Row Total DAX Measure Only Working Sometimes</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Row-Total-DAX-Measure-Only-Working-Sometimes/m-p/2808949#M88772</link>
      <description>&lt;P&gt;Thank you for the suggestion, but I don't think that would work for the conditional formatting logic that I was trying to create after figuring out this part of the formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SOLUTION:&lt;/P&gt;&lt;P&gt;I did however find that the reason it wasn't working was because I had created a "Sort" column to sort the Mapping column. I removed the sort from the mapping column and it ends up working.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 17:37:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Row-Total-DAX-Measure-Only-Working-Sometimes/m-p/2808949#M88772</guid>
      <dc:creator>GarlonYau</dc:creator>
      <dc:date>2022-09-30T17:37:57Z</dc:date>
    </item>
  </channel>
</rss>

