Forum Discussion

realMagnusKvale's avatar
realMagnusKvale
New Member
6 months ago
Solved

Field parameter returning list

Hi y'all 🤠🐮   I want to make a slicer for field parameters that returns a list of column names, not one column name per slicer choice (pardon my terminology if it's wrong).   The first example ...
  • Sergii24's avatar
    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! 🙂