Forum Discussion

MahsaTMahsa's avatar
MahsaTMahsa
Frequent Visitor
2 years ago

Need Help Adding Text Slicer to Table in Power BI

Hi everyone,

I'm working on a project in Power BI and need a table that changes its values based on three different slicers. The slicers I need are as follows:

  1. First Slicer: Contains text values
  2. Second Slicer: Contains numeric values (this slicer is set up correctly and works fine)
  3. Third Slicer: Contains a set of measures written with a calculated group (this slicer is also set up correctly and works fine)

My problem is adding the first slicer to the table. I'm not sure how to add this text slicer to my table so that the values are filtered based on the selections from the text slicer.

Could anyone guide me on how to do this? Any advice or practical examples would be greatly appreciated.

Thank you very much

3 Replies

  • hackcrr's avatar
    hackcrr
    Memorable Member

    Hi, MahsaTMahsa 

    You need to create a metric that is dynamically updated based on the slicer's selection. The following is an example of how to create such a metric:

    SelectedMeasure = 
    SWITCH(
        TRUE(),
        SELECTEDVALUE('Measure Slicer'[Measure]) = "Pre Month", [Pre Month Measure],
        SELECTEDVALUE('Measure Slicer'[Measure]) = "Pre Week", [Pre Week Measure],
        SELECTEDVALUE('Measure Slicer'[Measure]) = "Pre Year", [Pre Year Measure],
        SELECTEDVALUE('Measure Slicer'[Measure]) = "Pre Season", [Pre Season Measure]
    )

    Add it SelectedMeasure to your form visuals.This will ensure that the table is updated according to the selected measure in the third slicer.

    Ensure that all slicers are set to interact with the table visuals. You can check and adjust this by selecting each slicer, going to the Format tab, and setting Edit Interaction to.

     

     

    hackcrr

    If this post helps, then please consider Accept it as the solution and kudos to this post to help the other members find it more quickly

     

  • MahsaTMahsa's avatar
    MahsaTMahsa
    Frequent Visitor

    Hello

    I made the time slicer with the Calculation Measure and there is no problem
    My question now is for the text slicer, which includes categories, groups, etc. (the blue part in the picture)
    I don't know how to make this part of the table dynamic with slicer🤔

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello,hackcrr ,thanks for your concern about this issue.

    Your answer is excellent!
    And I would like to share some additional solutions below.
    Hi,MahsaTMahsa I am  glad to help you.

    According to your description, you want to realize that when clicking on the slicer the selected option is added as a column to the viusal

    For the text slicer you can try to add the field parameter.

     




    URL:
    Use parameters to visualize variables - Power BI | Microsoft Learn

    To add it as a slicer, you may need to rework your previous MEASURES a bit because the filtering conditions have changed.

    I've uploaded the pbix file I used for testing, hope this helps.

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
    Best Regards,
    Carson Jian,
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.