Forum Discussion
Dynamic Names axis based on selected filter.
- 3 years ago
Hey Anonymous,
This is possible by creating a table in which the regions are columns and the rows are countries. And then create a field parameter on it. I used the following sample data:Dim_Countries:
CountryRegionSales
1 A 8 2 A 12 3 A 54 4 B 21 5 B 76 6 B 32 7 B 89 8 B 21 9 C 40 10 C 4 Dim_Region:
RegionA B C 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):
CountryABC
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 Field paramter (refer to the general region column and call it 'All'. And select all the region columns from the combination table underneath):
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) }This is how the models looks:
Use the field parameter as a slicer. And also place the field parameter on the x axis of a visual.
'All' selected:
When you select one region:
Hi Anonymous
You can create field paramater and put the paramater to the axis, you can refer to the following link:
Solved: Re: How to dynamically calculate the percentage fo... - Microsoft Power BI Community
Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn
Best Regards,
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.