简体   繁体   中英

Distinct values from cell as filter - Power Bi

I have country column, where multiple values can appear in a cell.

Example, for row of column "Approved By", data appears in following way (data in a cell):

列参考图像

Is there a way in which I can take distinct values from this column and show it as a list using slicer, 参考是需要输出的图像

in this case if I select "India" as a the value in the slicer all rows where India appears as a country should come up in the grid.

Assuming you have a separate table (named Countries ) which comprises a single-column (named Country ) of unique country names, create the following measure :

MyFilter =
VAR SelectedCountry =
    MIN( Countries[Country] )
VAR ApprovedBy =
    MIN( 'Table'[Approved By] )
RETURN
    IF( SEARCH( SelectedCountry, ApprovedBy,, 0 ), 1 )

You can now add MyFilter to the Filters Pane and set it equal to 1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM