<?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: Dynamic Names axis based on selected filter. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Names-axis-based-on-selected-filter/m-p/2965855#M98985</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="417546" data-lia-user-login="Barthel" class="lia-mention lia-mention-user"&gt;Barthel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem with this is that the (Blank) is depended for the region. So in the 'country' field there is no blank, only in the Region fields. But then when I select Americas and is not equal to blank the other regions will only show the total of americas as blank. So I can't take the Blank out of the visual by using the filter panel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT I've found a solution with DAX.....I love DAX&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I did for the blanks is to create a "If(Selectedvalue("&amp;nbsp; and then for each 'Order' in the parameter a calculation measure where I filter out the blank for that region.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(SELECTEDVALUE('Parameter'[Parameter order])=1, CALCULATE([Margin], FILTER(Dim_Country_Region,Dim_Country_Region[A]&amp;lt;&amp;gt;BLANK())),&lt;/P&gt;&lt;P&gt;IF(SELECTEDVALUE('Parameter' [Parameter Order])=2, CALCULATE([Margin], FILTER(Dim_Country_Region,Dim_Country_Region[B]&amp;lt;&amp;gt;BLANK())),&lt;/P&gt;&lt;P&gt;IF(SELECTEDVALUE('Parameter' [Parameter Order])=3, CALCULATE([Margin], FILTER(Dim_Country_Region,Dim_Country_Region[C]&amp;lt;&amp;gt;BLANK())),&lt;/P&gt;&lt;P&gt;[Margin]))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;(hope this way, I made the DAX a bit readable/clear)&lt;/P&gt;&lt;P&gt;And that made the blanks disappear!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So thanks for the solution!&lt;/P&gt;</description>
    <pubDate>Tue, 13 Dec 2022 16:01:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-12-13T16:01:04Z</dc:date>
    <item>
      <title>Dynamic Names axis based on selected filter.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Names-axis-based-on-selected-filter/m-p/2962274#M98720</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've a question about a dynamic axis in charts. I have sales data from different countries. To put them all in a chart is a bit too much so I have sorted the countries into regions. So Americas, Europe, Africa and Asia. What I would like to show is that the chart shows the margins of all regions (coming from Dim_Countries[Region]) together, but when the user select a region in the filter the chart shows the country (coming from Dim_Countries[Country]) of the selected region.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have something fimiliar with quantities and amounts with Selected value but then I need to do a calculation. now it has to choose between two fields with names (Dim_Countries[Region] or Dim_Countries[Country]). How can I set this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried this with parameters and that work but now the users need to switch from regions to countries manually. So they have to select a region and change the view to countries manually. How can I set this automatically when the users select a region?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 11:02:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Names-axis-based-on-selected-filter/m-p/2962274#M98720</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-12T11:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Names axis based on selected filter.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Names-axis-based-on-selected-filter/m-p/2962605#M98750</link>
      <description>&lt;P&gt;Hey&amp;nbsp;Anonymous&lt;/a&gt;,&lt;BR /&gt;This is possible by creating a table in which the regions are columns and the rows are countries.&amp;nbsp;And then create a field parameter on it.&amp;nbsp;I used the following sample data:&lt;/P&gt;&lt;P&gt;Dim_Countries:&lt;/P&gt;&lt;P&gt;CountryRegionSales&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;54&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;76&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;32&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;89&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Dim_Region:&lt;BR /&gt;Region&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Dim_Country_Region (combination table in which you indicate per country to which region it belongs. You could create this table dynamically in M ​​by pivoting the region column in the countries table):&lt;/P&gt;&lt;P&gt;CountryABC&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Field paramter (refer to the general region column and call it 'All'. And select all the region columns from the combination table underneath):&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;Parameter = {
    ("All", NAMEOF('Dim_Region'[Region]), 0),
    ("A", NAMEOF('Dim_Country_Region'[A]), 1),
    ("B", NAMEOF('Dim_Country_Region'[B]), 2),
    ("C", NAMEOF('Dim_Country_Region'[C]), 3)
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how the models looks:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Use the field parameter as a slicer. And also place the field parameter on the x axis of a visual.&lt;/P&gt;&lt;P&gt;'All' selected:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;When you select one region:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 13:21:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Names-axis-based-on-selected-filter/m-p/2962605#M98750</guid>
      <dc:creator>Barthel</dc:creator>
      <dc:date>2022-12-12T13:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Names axis based on selected filter.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Names-axis-based-on-selected-filter/m-p/2964171#M98854</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;You can create field paramater and put the paramater to the axis, you can refer to the following link:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/How-to-dynamically-calculate-the-percentage-for-more-than-one/m-p/2955621#M1011951" target="_blank"&gt;Solved: Re: How to dynamically calculate the percentage fo... - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters" target="_blank"&gt;Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SUP&gt;Best Regards,&lt;/SUP&gt;&lt;/P&gt;
&lt;P&gt;&lt;SUP&gt;Yolo Zhu&lt;/SUP&gt;&lt;/P&gt;
&lt;P&gt;&lt;SUP&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/SUP&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 05:35:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Names-axis-based-on-selected-filter/m-p/2964171#M98854</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-13T05:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Names axis based on selected filter.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Names-axis-based-on-selected-filter/m-p/2965057#M98915</link>
      <description>&lt;P&gt;Oh thanks a lot this works. I only have one issue with this method. I now see the others as blank in my chart.&lt;/P&gt;&lt;P&gt;So the total is always the same (total of the entire world).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I think this has to do with the&amp;nbsp;&lt;SPAN&gt;Dim_Country_Region where country 4 belongs to region B but not to region A or C. if A is selected he shows the figures of 1, 2, 3 and blank (which is 4 till 10). In the table these fields (4 till 10) are 'null' for region A. But I have no idea how to get rid of the 'others' in the chart.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 11:10:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Names-axis-based-on-selected-filter/m-p/2965057#M98915</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-13T11:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Names axis based on selected filter.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Names-axis-based-on-selected-filter/m-p/2965276#M98928</link>
      <description>&lt;P&gt;Hey&amp;nbsp;Anonymous&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Yeah you are right. I think the easiest way to fix this is to filter the visual, where 'country' is not equal to 'Blank'.&amp;nbsp;You can do this in the filter panel once you've selected the visal.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 12:32:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Names-axis-based-on-selected-filter/m-p/2965276#M98928</guid>
      <dc:creator>Barthel</dc:creator>
      <dc:date>2022-12-13T12:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Names axis based on selected filter.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Names-axis-based-on-selected-filter/m-p/2965855#M98985</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="417546" data-lia-user-login="Barthel" class="lia-mention lia-mention-user"&gt;Barthel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem with this is that the (Blank) is depended for the region. So in the 'country' field there is no blank, only in the Region fields. But then when I select Americas and is not equal to blank the other regions will only show the total of americas as blank. So I can't take the Blank out of the visual by using the filter panel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT I've found a solution with DAX.....I love DAX&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I did for the blanks is to create a "If(Selectedvalue("&amp;nbsp; and then for each 'Order' in the parameter a calculation measure where I filter out the blank for that region.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(SELECTEDVALUE('Parameter'[Parameter order])=1, CALCULATE([Margin], FILTER(Dim_Country_Region,Dim_Country_Region[A]&amp;lt;&amp;gt;BLANK())),&lt;/P&gt;&lt;P&gt;IF(SELECTEDVALUE('Parameter' [Parameter Order])=2, CALCULATE([Margin], FILTER(Dim_Country_Region,Dim_Country_Region[B]&amp;lt;&amp;gt;BLANK())),&lt;/P&gt;&lt;P&gt;IF(SELECTEDVALUE('Parameter' [Parameter Order])=3, CALCULATE([Margin], FILTER(Dim_Country_Region,Dim_Country_Region[C]&amp;lt;&amp;gt;BLANK())),&lt;/P&gt;&lt;P&gt;[Margin]))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;(hope this way, I made the DAX a bit readable/clear)&lt;/P&gt;&lt;P&gt;And that made the blanks disappear!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So thanks for the solution!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 16:01:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Names-axis-based-on-selected-filter/m-p/2965855#M98985</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-13T16:01:04Z</dc:date>
    </item>
  </channel>
</rss>

