<?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: URGENT! converted measure to calculated column but it's giving me only 100% in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3852935#M150527</link>
    <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for helping me out here. I ran the code you suggested but I'm only getting zero for all the states.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Apr 2024 08:22:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-04-19T08:22:56Z</dc:date>
    <item>
      <title>URGENT! converted measure to calculated column but it's giving me only 100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3848676#M150387</link>
      <description>&lt;P&gt;Hello Power BI Community,&lt;/P&gt;&lt;P&gt;Attached is the sample pbix:&amp;nbsp;&lt;A href="https://drive.google.com/file/d/1Oav8yBIvQzhYOmLAw2qd2tjC0Qm6wtKL/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1Oav8yBIvQzhYOmLAw2qd2tjC0Qm6wtKL/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I've created a measure that allows me to calculate the sales contribution % by states:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Combined_LW_PY_Contribution = 
max('Data by Channels'[State]) &amp;amp; ": " &amp;amp;  FORMAT(
DIVIDE(
    SUM('Data by Channels'[Latest Week]),
    CALCULATE(
        SUM('Data by Channels'[Latest Week]),
        // ALL('Data by Channels'[State]),
        'Data by Channels'[State] &amp;lt;&amp;gt; "Total US" &amp;amp;&amp;amp; 'Data by Channels'[State] &amp;lt;&amp;gt; "Core 7 States"
    )
), "0.0%")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data I'm getting is the following and is the expected output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I need this measure as a calculated column to use in a map chart, so I tired to convert it into a calculated column, so far I've been unsuccessful. here is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Combined_LW_PY_Contribution_Column = 
VAR CurrentState = 'Data by Channels'[State]
VAR TotalLatestWeek = CALCULATE(
    SUM('Data by Channels'[Latest Week]),
    ALL('Data by Channels'[State]),
    'Data by Channels'[State] &amp;lt;&amp;gt; "Total US" &amp;amp;&amp;amp; 'Data by Channels'[State] &amp;lt;&amp;gt; "Core 7 States"
)
VAR StateLatestWeek = CALCULATE(
    SUM('Data by Channels'[Latest Week]),
    FILTER(
        ALL('Data by Channels'[State]),
        'Data by Channels'[State] = CurrentState
    )
)
RETURN
    CurrentState &amp;amp; ": " &amp;amp;  FORMAT(
        DIVIDE(
            StateLatestWeek,
            TotalLatestWeek
        ), "0.0%"
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This is what I'm getting as calc column's output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please take a look and let me know if you need anything else.&lt;BR /&gt;Look forward to your replies.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/14361" target="_blank" rel="noopener"&gt;@MFelix&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;,&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/148838" target="_blank" rel="noopener"&gt;@amitchandak&lt;/A&gt;&lt;SPAN&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;, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="707963" data-lia-user-login="Joe_Barry" class="lia-mention lia-mention-user"&gt;Joe_Barry&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/19851" target="_blank" rel="noopener"&gt;@Ashish_Mathur,&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 08:38:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3848676#M150387</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-18T08:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: URGENT! converted measure to calculated column but it's giving me only 100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3848764#M150390</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but please try something like below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Combined_LW_PY_Contribution_Column =
VAR CurrentState = 'Data by Channels'[State]
VAR TotalLatestWeek =
    SUMX (
        ADDCOLUMNS (
            FILTER (
                'Data by Channels',
                'Data by Channels'[State] &amp;lt;&amp;gt; "Total US"
                    &amp;amp;&amp;amp; 'Data by Channels'[State] &amp;lt;&amp;gt; "Core 7 States"
            ),
            "@value", [Latest Week]
        ),
        [@value]
    )
VAR StateLatestWeek =
    SUMX (
        ADDCOLUMNS (
            FILTER ( 'Data by Channels', 'Data by Channels'[State] = CurrentState ),
            "@value", [Latest Week]
        ),
        [@value]
    )
RETURN
    CurrentState &amp;amp; ": "
        &amp;amp; FORMAT ( DIVIDE ( StateLatestWeek, TotalLatestWeek ), "0.0%" )
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 18 Apr 2024 08:51:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3848764#M150390</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-04-18T08:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: URGENT! converted measure to calculated column but it's giving me only 100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3848852#M150392</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Thanks a lot for your reply. I think we are close to the solution.&lt;BR /&gt;I ran your code as you can see in the screenshot below:&amp;nbsp;&lt;BR /&gt;But the % contribution numbers are a bit different from the measure (Combined_LW_PY_Contribution) I&amp;nbsp;created.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;there are other columns in my data set that might be affecting the column calculation like: "Measures" and "Channel". How do I add them to the filter context of this column?&lt;BR /&gt;&lt;BR /&gt;please take a look at the sample pbix as well if that helps to understand the data a bit better. Thanks a lot again!&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 09:04:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3848852#M150392</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-18T09:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: URGENT! converted measure to calculated column but it's giving me only 100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3852663#M150516</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;It is quite difficult for me to understand the filter context that are applied to the measure. I think that is one of the reasons why my calculated column formula does not produce the result that you want.&lt;BR /&gt;Could you please consider what filter context are applied to your measure and visualization on the left, especailly the relationships in the datamodel, slicers on the top, and the filters in the filter pane? And then you can try to apply those to the calcualted column.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 07:15:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3852663#M150516</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-04-19T07:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: URGENT! converted measure to calculated column but it's giving me only 100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3852873#M150522</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;, please allow me to provide another insight:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't open your link because of some security policy.&amp;nbsp;I have created a simple sample to fulfill your needs, hope it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My sample:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;modify the formula as follows&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Combined_LW_PY_Contribution_Column = 
[State] &amp;amp; ": " &amp;amp;  FORMAT(
DIVIDE(
    CALCULATE(
        SUM('Data by Channels'[Latest Week]),
        'Data by Channels'[State] &amp;lt;&amp;gt; "Total US" &amp;amp;&amp;amp; 'Data by Channels'[State] &amp;lt;&amp;gt; "Core 7 States"
    ),
    CALCULATE(
        SUM('Data by Channels'[Latest Week]),
        ALL('Data by Channels'),
        'Data by Channels'[State] &amp;lt;&amp;gt; "Total US" &amp;amp;&amp;amp; 'Data by Channels'[State] &amp;lt;&amp;gt; "Core 7 States"
    )
), "0.0%")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yulia Xu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 08:06:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3852873#M150522</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-19T08:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: URGENT! converted measure to calculated column but it's giving me only 100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3852929#M150525</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for the suggestion. I tried to add all the filters and slicers that were required for my visualization. However I think I'm missing something in the Dax code as I'm getting blank for the % contribution. Can you take a look at the code once? See if I'm missing something.&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Combined_LW_PY_Contribution_Column = 
VAR CurrentBrand = max('Competitors Flag'[Products Clean])
VAR CurrentState = 'Data by Channels'[State]
VAR CurrentMeasure = 'Data by Channels'[Measures] // Replace with the actual column name if different
VAR CurrentChannel = 'Data by Channels'[Channel] // Replace with the actual column name if different
VAR TotalLatestWeek =
    SUMX (
        ADDCOLUMNS (
            FILTER (
                'Data by Channels',
                'Data by Channels'[State] &amp;lt;&amp;gt; "Total US"
                    &amp;amp;&amp;amp; 'Data by Channels'[State] &amp;lt;&amp;gt; "Core 7 States"
                    &amp;amp;&amp;amp; 'Data by Channels'[Measures] = CurrentMeasure
                    &amp;amp;&amp;amp; 'Data by Channels'[Channel] = CurrentChannel
                    &amp;amp;&amp;amp; max('Competitors Flag'[Products Clean]) = CurrentBrand
                     &amp;amp;&amp;amp; max('Competitors Flag'[Brands Sorting]) = 1
            ),
            "@value", [Latest Week]
        ),
        [@value]
    )
VAR StateLatestWeek =
    SUMX (
        ADDCOLUMNS (
            FILTER ( 
                'Data by Channels', 
                'Data by Channels'[State] = CurrentState
                &amp;amp;&amp;amp; 'Data by Channels'[Measures] = CurrentMeasure
                &amp;amp;&amp;amp; 'Data by Channels'[Channel] = CurrentChannel
                &amp;amp;&amp;amp; max('Competitors Flag'[Products Clean]) = CurrentBrand
                 &amp;amp;&amp;amp; max('Competitors Flag'[Brands Sorting]) = 1
            ),
            "@value", [Latest Week]
        ),
        [@value]
    )
RETURN
    CurrentState &amp;amp; ": "
        &amp;amp; FORMAT ( DIVIDE ( StateLatestWeek, TotalLatestWeek ), "0.0%" ) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 08:20:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3852929#M150525</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-19T08:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: URGENT! converted measure to calculated column but it's giving me only 100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3852935#M150527</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for helping me out here. I ran the code you suggested but I'm only getting zero for all the states.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 08:22:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3852935#M150527</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-19T08:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: URGENT! converted measure to calculated column but it's giving me only 100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3853081#M150538</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since I don't have your data and "Lastest Week" is a column in my test, could you please tell me if your "Lastest Week" is a measure or a column?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yulia Xu&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 09:12:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3853081#M150538</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-19T09:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: URGENT! converted measure to calculated column but it's giving me only 100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3853772#M150568</link>
      <description>&lt;P&gt;latest week is also a column in my dataset&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 12:46:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URGENT-converted-measure-to-calculated-column-but-it-s-giving-me/m-p/3853772#M150568</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-19T12:46:17Z</dc:date>
    </item>
  </channel>
</rss>

