Forum Discussion

anedesquerra's avatar
anedesquerra
New Member
5 years ago
Solved

Get selected values in powerBI listbox from Python visual script

I'm creating a Python visual inside a PowerBI Desktop dashboard, and I need to filter out a dataset I read from a local folder based on selected values of slicers. So far, I can get all values from e...
  • anedesquerra's avatar
    5 years ago

    Hello, community! Thanks anyway for your reviews!

    Finally, after several trial-error codes, I found one solution that works the way I wanted.

    Here goes the one-line code in Python if someone needs it in the future.

     

    My data field is named steel_fam_desc, so you just need to change your current field name in your code. 

    steel_fam_desc = list(set(dataset.steel_fam_desc))
     
    Cheers up community!