Forum Discussion

Iselghan's avatar
Iselghan
New Member
9 years ago
Solved

How to create Parameter (Like in Tableau) to select visualizing between two different values?

Hi, 

 

Would appreciate guidance on creating a list parameter that could act like a slicer to allow users to choose between showing two different values (commitments or disbursements). I am used to working in Tableau which allows you to define a parameter and filter for different values. 

 

Any helos would be greatly appreciated. 

 

Best, 

IB

7 Replies

      • tarun16feb's avatar
        tarun16feb
        Regular Visitor

        Can you please post a workbook with the solution if possible.

  • Anonymous's avatar
    Anonymous
    Not applicable

    I am trying to create a parameter like one we had in tableau, replicate like a simple Slicer in PowerBi so that the user can select from the dropdown. I am not sure how and if that works in PBi. My field has 2 values and I want to add 3 more and make it a parameter and display it like a slicer on the report

  • hmericchan's avatar
    hmericchan
    Frequent Visitor

    Hi all, 
    Not sure if it's too late to answer this in 2024 ğŸ˜…
    Somehow I do come across this situation today and below is my solution: 
    To create a custom slicer, you can either create a table by uploading one with Excel as new data source or create it directly using DAX. 

    For my case, as the table may change from time to time, I created it with DAX for easy maintenance:

    Language = DATATABLE("Language", STRING, {{"EN"}, {"ZH"}})
    My use case is use a language slicer to swap two different languages of Type (EN) and Type (ZH), EN as English and ZH as Chinese:

    Type =
    IF(HASONEFILTER('Language'[Language]),
    SWITCH(TRUE,
    MIN('Language'[Language])="EN", MIN('OC Utilization & Inventory'[Type (EN)]), MIN('Language'[Language])="ZH", MIN('OC Utilization & Inventory'[Type (ZH)])
    ),
    MIN('OC Utilization & Inventory'[Type (EN)]))

    Hope this help 🙂