Forum Discussion
Field parameter returning list
- 6 months ago
Hi realMagnusKvale, you can enrich the field parameter code with extra columns to group values:
Parameter New = { ("column_1_orig", NAMEOF('table'[column_1_orig]), 0, "Orig"), ("column_2_orig", NAMEOF('table'[column_2_orig]), 1, "Orig"), ("column_3_orig", NAMEOF('table'[column_3_orig]), 2, "Orig"), ("column_4_orig", NAMEOF('table'[column_4_orig]), 3, "Orig"), ("column_5_orig", NAMEOF('table'[column_5_orig]), 4, "Orig"), ("column_1_test", NAMEOF('table'[column_1_test]), 5, "Test"), ("column_2_test", NAMEOF('table'[column_2_test]), 6, "Test"), ("column_3_test", NAMEOF('table'[column_3_test]), 7, "Test"), ("column_4_test", NAMEOF('table'[column_4_test]), 8, "Test"), ("column_5_test", NAMEOF('table'[column_5_test]), 9, "Test") }Now, you can create a hierarchy like in the Option #1. However, it doesn't block a user from selecting some items from different groups. What you can do is to apply the Option #2 where you use 2 separate slicers: the first one forces a user to select "Orig" or "Test" group and then the second one allows to select the items. Important: the second slicer should not filter the first one (check iteraction b/w items)
I'm attaching pbix.
Good luck with your project! 🙂
Can you please explain this?
combinations of columns, but the only two combinations that actually makes sense are column 1, ... column 5 for either orig or test.. In addition, the choice is sensitive to the order of the slicer choice, which I don't want either...
Also, Power BI does not preserve the order in which selections are made. The column order is determined by the order column in the field parameter.
danextian, yes:
1.
In the first example, the user can choose e.g. Column 1, Orig and Column 3, Test. In my case, that's a non sensical choice. I'd like to force the user to make one of two choices, "Orig" or "Test", each of which returns a list of five column names.
2.
I just checked, and wheter I choose 5, 3, ..., 1 or 1, 2, ..., 5 makes a difference: The matrix and bar chart that use the field parameters in question depend on the order of the choice made by the user, I can see it happen.. I'd like that not to be the case.. I could consider taking a screenshot, but I'd have to remove a lot of information, so I don't share anything that I'm not supposed to.