Forum Discussion
Dynamic slicing based on 2 different dimentions
Hi All,
I am new to power BI , i need help in achieving dynamic slicer functionality based on what user want to select to see.
example
, I have salesmetric and dimentions as region and product category.
User should have ability to select dimention to see his sales one at a time.
thanks
SK
5 Replies
- dkay84_PowerBIMicrosoft Employee
If you add those fields (individually) to slicers, when you click on a geography or product category within the slicer, the data will be filtered. So lets say you have a line bar chart that has sales as the value and the x axis is month name. If you click on the geography slicer, the data that is aggregated in the bar chart will get filtered and the reflect the selected geography.
If you follow best practices of creating a star schema data model, then you should break out your geo and product dimensions into their own tables and creating relationships. Then, the only difference from what I described above will be (possibly) making sure that the relationships are bi-directional and that when you add a value to the slicer, it comes from the dimension table and not the fact table.
- kesanasuRegular Visitor
Hi Thansk for your reply.
I am advance user of tableau, and i am trying to see if there is some thing equivalent to tableau's parameter in power BI
Could you plese help me
- dkay84_PowerBIMicrosoft EmployeeAdd a slicer visual to your report and add the field you want to it (ie geography). Then add a different visual, like a table or chart, to display the sales value. Now when you click on a slicer value the data in the chart will update.
Your ask about parameters is different from your first question, and can be created in two different ways. If you want a parameter like a database connection string that can be changed by the user, you can create a parameter for that in the query editor. If you want a list of values that can be selected for something like a what-if analysis, you can make a table of all the incremental values, use this table/field in your slicer, and have whatever measures used to calculate the what-if scenario pull in the selected value.
Both of these are thoroughly documented online.
- v-yulgu-msftMicrosoft Employee
Hi kesanasu,
What did you mean "dynamic slicer functionality"? Please elaborate your scenario with examples.
Based on my assumption, there should be two columns [region] and [product category] in your source table, right? You want to filter data records based on one of them depend on users' need, right?
If so, you could add two slicer into report body, drag [region] into one slicer, drag [product category] into another one. User can choose selection from any one of the two slicers. For example, if selecting region1 from first slicer, and leave the other slicer without any selection, data records will only be filtered according to region1. If specifying values for both of them, then, both of them will affect data records displayed on visual.
In short, Power BI slicer works as tableau's parameter.
Reference: Create and format slicers
Slicers in Power BI service (Tutorial)Best regards,
Yuliana Gu