Forum Discussion
Filtering based on a specific value and any other values
- 6 years ago
If that first value doesn't change, you could add a Groups column with two buckets (the top one and "other values"). See this link
https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-grouping-and-binning
If it does change, you can do it in the query editor too. Just add an Index column starting from 1, and then add a custom column with this formula
= if [Index] =1 then "First Value" else "Other Values"
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
If that first value doesn't change, you could add a Groups column with two buckets (the top one and "other values"). See this link
https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-grouping-and-binning
If it does change, you can do it in the query editor too. Just add an Index column starting from 1, and then add a custom column with this formula
= if [Index] =1 then "First Value" else "Other Values"
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
mahoneypat, In regard of grouping solution, is it as in the following?
Also what if we got a new value in the future, should it considered as "Other"?
- mahoneypat6 years ago
Microsoft Employee
That is correct. It is up to you if you want to create a group called "Others" (or whatever you want) or use the default Other group. Any new values would go in the Other if you go with the latter, but you would have to update it if you use the former.
Also, the 2nd approach I mentioned should be pretty robust. If you want to show that first value, you could adapt the M code to show the actual value instead of "First Value" just replace "First Value" with a reference to the column name (e.g., [ColumnName]). I can't see the name in the reply window otherwise I would have just typed that.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- MohannadSh19966 years ago
Microsoft Employee
mahoneypat, Thanks for the answers!