<?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: How to use measure as X asis in column chart in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-measure-as-X-asis-in-column-chart/m-p/3655822#M141641</link>
    <description>&lt;P&gt;It seems like you are trying to create a measure to calculate aging and want to use this measure as the X-axis in a column chart or pivot table. However, measures in Power BI are typically used in the Values area of a visual, not directly in the rows or columns.&lt;/P&gt;&lt;P&gt;To use your aging measure in a column chart or pivot table, you need to create a dimension that represents the categories on the X-axis. In your case, it seems like you want to categorize the aging into different buckets (e.g., 1-30 days, 31-60 days, 61-90 days, etc.).&lt;/P&gt;&lt;P&gt;Here's how you can achieve this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a new table or use an existing one to represent the aging buckets. You can use the following DAX code to create a calculated column in this table:&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;AgingCategory =&lt;BR /&gt;SWITCH(&lt;BR /&gt;TRUE(),&lt;BR /&gt;[aging_caculate] = 1, "0-30 days",&lt;BR /&gt;[aging_caculate] = 2, "31-60 days",&lt;BR /&gt;[aging_caculate] = 3, "61-90 days",&lt;BR /&gt;[aging_caculate] = 4, "More than 90 days",&lt;BR /&gt;"Unknown"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code uses the result of your aging_caculate measure to categorize the aging into different buckets.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Now, use the new AgingCategory column as the Axis field in your column chart or pivot table.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Here's a step-by-step guide:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Open the report where you want to create the chart.&lt;/LI&gt;&lt;LI&gt;Drag and drop the AgingCategory column to the Axis area of your visual (column chart or pivot table).&lt;/LI&gt;&lt;LI&gt;Drag your aging_caculate measure to the Values area to show the calculated aging.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This way, you'll have a column chart or pivot table with your aging measure on the Y-axis and the aging categories on the X-axis.&lt;/P&gt;&lt;P&gt;Remember to adjust the code and column names based on your actual table and column names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2024 06:52:17 GMT</pubDate>
    <dc:creator>123abc</dc:creator>
    <dc:date>2024-01-24T06:52:17Z</dc:date>
    <item>
      <title>How to use measure as X asis in column chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-measure-as-X-asis-in-column-chart/m-p/3655616#M141627</link>
      <description>&lt;P&gt;Dear all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote the measure to caculate aging my measure work well. However I can not put the measure to row or column of the chart or pivot table.&amp;nbsp;Could you please advise if any solution for my case?&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;aging_caculate = 
    var _date_select = SELECTEDVALUE(date_table[Date])
    var a = CALCULATE(SUMX(Table1,
                            SWITCH(TRUE(),
                                DATEDIFF(Table1[date],_date_select,DAY)&amp;lt;30,1,
                                AND(DATEDIFF(Table1[date],_date_select,DAY)&amp;gt;30,DATEDIFF(Table1[date],_date_select,DAY)&amp;lt;60),2,
                                AND(DATEDIFF(Table1[date],_date_select,DAY)&amp;gt;60,DATEDIFF(Table1[date],_date_select,DAY)&amp;lt;90),3,
                                4                        
                            )))
    RETURN
        a
            &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1aTXK1I69fhWZcNY1sYJZHc0hd6hkQKqI/view?usp=sharing" target="_self"&gt;pbix file here&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 05:10:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-measure-as-X-asis-in-column-chart/m-p/3655616#M141627</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-24T05:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to use measure as X asis in column chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-measure-as-X-asis-in-column-chart/m-p/3655822#M141641</link>
      <description>&lt;P&gt;It seems like you are trying to create a measure to calculate aging and want to use this measure as the X-axis in a column chart or pivot table. However, measures in Power BI are typically used in the Values area of a visual, not directly in the rows or columns.&lt;/P&gt;&lt;P&gt;To use your aging measure in a column chart or pivot table, you need to create a dimension that represents the categories on the X-axis. In your case, it seems like you want to categorize the aging into different buckets (e.g., 1-30 days, 31-60 days, 61-90 days, etc.).&lt;/P&gt;&lt;P&gt;Here's how you can achieve this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a new table or use an existing one to represent the aging buckets. You can use the following DAX code to create a calculated column in this table:&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;AgingCategory =&lt;BR /&gt;SWITCH(&lt;BR /&gt;TRUE(),&lt;BR /&gt;[aging_caculate] = 1, "0-30 days",&lt;BR /&gt;[aging_caculate] = 2, "31-60 days",&lt;BR /&gt;[aging_caculate] = 3, "61-90 days",&lt;BR /&gt;[aging_caculate] = 4, "More than 90 days",&lt;BR /&gt;"Unknown"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code uses the result of your aging_caculate measure to categorize the aging into different buckets.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Now, use the new AgingCategory column as the Axis field in your column chart or pivot table.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Here's a step-by-step guide:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Open the report where you want to create the chart.&lt;/LI&gt;&lt;LI&gt;Drag and drop the AgingCategory column to the Axis area of your visual (column chart or pivot table).&lt;/LI&gt;&lt;LI&gt;Drag your aging_caculate measure to the Values area to show the calculated aging.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This way, you'll have a column chart or pivot table with your aging measure on the Y-axis and the aging categories on the X-axis.&lt;/P&gt;&lt;P&gt;Remember to adjust the code and column names based on your actual table and column names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 06:52:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-measure-as-X-asis-in-column-chart/m-p/3655822#M141641</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-01-24T06:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to use measure as X asis in column chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-measure-as-X-asis-in-column-chart/m-p/3656362#M141658</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403667" data-lia-user-login="123abc" class="lia-mention lia-mention-user"&gt;123abc&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your solution, In my measure I have a date_selection in to pick the date I want to caculate the aging.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var _date_select = SELECTEDVALUE(date_table[Date])&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Following your comments, I have to create new virtual table with a column base on the value of measure above , right?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 09:51:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-measure-as-X-asis-in-column-chart/m-p/3656362#M141658</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-24T09:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to use measure as X asis in column chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-measure-as-X-asis-in-column-chart/m-p/3658998#M141781</link>
      <description>&lt;P&gt;Yes, you're correct. If your measure includes a variable _date_select that is based on the selected date in a slicer or filter, you can create a new table that includes the unique values of your measure. This will allow you to use that table for your X-axis in a column chart.&lt;/P&gt;&lt;P&gt;Here's how you can modify the previous instructions:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create a Table Visualization:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Go to the "Data" view in Power BI.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Click on "New Table" in the "Modeling" tab.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Enter the following DAX formula to create a new table:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;AgingTable = VALUES('YourTableName'[aging_caculate])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;OL&gt;&lt;LI&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Replace 'YourTableName' with the actual name of your table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create a Column Chart:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Go back to the "Report" view in Power BI.&lt;/LI&gt;&lt;LI&gt;Drag the "aging_caculate" field from your new "AgingTable" to the "Axis" or "X-axis" well of your column chart.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;By creating the "AgingTable" using the unique values from your "aging_caculate" measure, you are essentially creating a table that represents the distinct categories of aging based on the selected date.&lt;/P&gt;&lt;P&gt;Remember to ensure that your chart is interactive and that it reacts to changes in the slicer or filter that affect the _date_select variable in your measure. This way, the chart will dynamically update based on the selected date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 25 Jan 2024 06:34:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-measure-as-X-asis-in-column-chart/m-p/3658998#M141781</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-01-25T06:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to use measure as X asis in column chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-measure-as-X-asis-in-column-chart/m-p/3659185#M141791</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403667" data-lia-user-login="123abc" class="lia-mention lia-mention-user"&gt;123abc&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your advice, I tried with above suggestion however It show the error as below screenshot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help check what I make some wrong ? It stuck here so I can not process for the next step.&amp;nbsp;&lt;/P&gt;&lt;P&gt;my pbix file &lt;A href="https://drive.google.com/file/d/1aTXK1I69fhWZcNY1sYJZHc0hd6hkQKqI/view?usp=sharing" target="_self"&gt;here&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 07:23:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-measure-as-X-asis-in-column-chart/m-p/3659185#M141791</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-25T07:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to use measure as X asis in column chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-measure-as-X-asis-in-column-chart/m-p/3659247#M141794</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403667" data-lia-user-login="123abc" class="lia-mention lia-mention-user"&gt;123abc&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your guidance, I tried to create virtual table contain only values from the measure, however I got the error as the screenshot below, could you please help check what wrong with my formula ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1aTXK1I69fhWZcNY1sYJZHc0hd6hkQKqI/view?usp=sharing" target="_self"&gt;Here is my pbix file&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 07:39:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-measure-as-X-asis-in-column-chart/m-p/3659247#M141794</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-25T07:39:21Z</dc:date>
    </item>
  </channel>
</rss>

