Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Iselghan
New Member

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

1 ACCEPTED SOLUTION
ImkeF
Community Champion
Community Champion

Is this what you're looking for?: http://sqljason.com/2012/11/measure-selection-using-slicers-in.html

Instead of a linked table like in Excel you can use the "Enter Data"-table generator to fill in the names of the measures you want to display in your slicer.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

7 REPLIES 7
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 🙂
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

ImkeF
Community Champion
Community Champion

Is this what you're looking for?: http://sqljason.com/2012/11/measure-selection-using-slicers-in.html

Instead of a linked table like in Excel you can use the "Enter Data"-table generator to fill in the names of the measures you want to display in your slicer.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Yes and it worked great. Thanks a lot!

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

ImkeF
Community Champion
Community Champion

There is a file to download in the link I've mentioned. It works the same in Power BI.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Anonymous
Not applicable

Hi Inke,

 

that link no longer works. Do you happen to have time to re-explain?

 

Thanks.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors