Forum Discussion
Replicating Tableau Parameter/Filter in Power BI
Hi all,
I am trying to replicate a functionality which I used to use in Tableau. The functionality was;
1) I created a Parameter with a list of values, lets call them Value A, Value B and Value C
2) A calculated field like below was created,
IF p.Selection = "Value A" THEN Column1=1
ELSEIF p.Selection = "Value B" THEN Column2=1
ELSEIF p.Selection = "Value C" THEN Column 3=1
ELSE ""
END
3) This calculated field was then added to the filters pane.
4) When a user made a selection using the dropdown parameter, Tableau would then filter the respective column to where the value was 1.
My query, is this possible to replicate within Power BI? Apologies if this is a basic query - I have tried working with slicers and parameters with nothing producing the desired result so I think I am missing something. Any help is much appreciated.
Thanks,
Daniel
Hi DKelso1992
To achieve the goal,
after you add field parameters please follow these steps :1. Add column to the parameters table:
2 . Create a flag measure for the desired filtering :
test =varsele_column=SELECTEDVALUE('Parameter'[selected column])returnSWITCH( TRUE(),sele_column="column 1" && max('Table'[Column 1])= 1 ,1,sele_column="column 2" && max('Table'[Column 2])= 1 ,1,sele_column="column 3" && max('Table'[Column 3])= 1 ,1,0)Put the "selected column" on the slicerand use a measure that you created as a filter to the roles visual:
result :
pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi, DKelso1992
Maybe you need to filter other visuals by the created flag measure too or to modify the model.
I don't think there is an option to answer this kind of question without access to the report file.
Please share a link to the dummy pbix and I will try to help.If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi DKelso1992
This is not working because all filter manipulations are from parameters.
The parameters are not the same functionality as the dim table with a "normal key".So as I see the solution here is:
1. To use all parameter manipulations directly from the fact table.
The updated pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
9 Replies
- Ritaf1983
Super User
Hi DKelso1992
Why do you need 3 different columns for this?
Can you please share a dummy table and the desired result?- DKelso1992Frequent Visitor
Hi Ritaf1983
Each column relates to specific groups that the individual might be a member of, so for example a CEO could be a member of group 1,2 and 3. Where as an administrative assistant would only be a member of group 1.
I am unable to attach any files to this post (Done a Google search and seems to be a known issue https://community.fabric.microsoft.com/t5/Desktop/how-to-attach-pbix-file-in-this-forum/td-p/404432)
I have included some data in a table below which may be of some help, basically when a user selects "Column 1" as an option from a parameter, it should show data relating to all job roles. Select Column 2, it should only show data relating to Job roles with a 1 in column 2, and selecting Column 3 in the parameter should only show data relating to CEO and CFO.
Thanks in advance,
DanielRole Column 1 Column 2 Column 3 Chief executive officer 1 1 1 Chief financial officer 1 1 1 Chief information officer 1 1 Chief marketing officer 1 1 Chief operations officer 1 1 Human resources manager 1 IT Manager 1 Marketing manager 1 Product manager 1 Sales manager 1 Administrative assistant 1 - Ritaf1983
Super User
Hi DKelso1992
To achieve the goal,
after you add field parameters please follow these steps :1. Add column to the parameters table:
2 . Create a flag measure for the desired filtering :
test =varsele_column=SELECTEDVALUE('Parameter'[selected column])returnSWITCH( TRUE(),sele_column="column 1" && max('Table'[Column 1])= 1 ,1,sele_column="column 2" && max('Table'[Column 2])= 1 ,1,sele_column="column 3" && max('Table'[Column 3])= 1 ,1,0)Put the "selected column" on the slicerand use a measure that you created as a filter to the roles visual:
result :
pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly