Forum Discussion
Measure to filter only required column values
- 4 years ago
Hi Gaz_Chapp
Try this measure to create a new table by DAX code:
Filtered Table = filter('Table','Table'[TransAtmEftposId] in {"9V12345D","9V54321D"})Original Table :
Filtered Table:
In Power Query add click on "Insert Step After" and use this code [add new codes with OR at the end]:
= Table.SelectRows(#"Changed Type", each ([TransAtmEftposId] = "9V12345D" or [TransAtmEftposId] = "9V54321D"))If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos✌️!!
Hi Gaz_Chapp
Try this measure to create a new table by DAX code:
Filtered Table = filter('Table','Table'[TransAtmEftposId] in {"9V12345D","9V54321D"})Original Table :
Filtered Table:
In Power Query add click on "Insert Step After" and use this code [add new codes with OR at the end]:
= Table.SelectRows(#"Changed Type", each ([TransAtmEftposId] = "9V12345D" or [TransAtmEftposId] = "9V54321D"))
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos✌️!!
Thanks Vahid, sorry for the late reply, I have been away this week on leave. I tried both examples but am unsure if you intended them to be two independant ways of applying the solution, or if you are suggesting I use both at the same time, i.e. create the new table AND apply the new filter step?
Using the second example of your code in a new step is basically what I did myself when manually adding new ID's, and that works fine without adding a new filtered table. Also, if I do create the filtered table I am assuming that I should then use the TransAtmEftposId column in the visualisation to filter out the required ID's?
Lastly, I need to add a relationship between the existing and new tables otherwise Power BI throws an error regarding the table relationship, and when I do create a relationship I receive a cardinality warning that it is a "many to many" relationship, is that OK to do? Thanks, Garry.