Forum Discussion

id9213's avatar
id9213
Helper I
3 years ago
Solved

Use a list to filter fields

Hi everybody,

 

I am quite new using Power BI and I would have a question regarding a graph I want to make.

Here's the data I have: a staffing sheet summarizing the number of days each employee work, on a specific deal.

I would like to use a list with the name of all the employees that would "behave" like a filter in order to select the right field to make the graphs.

 

My graphs are working the way I want for a specific employee but, if I want to create them for a different one, I have to select it manually in the fields list and replace it in the filter section of the graph.

I do not know if it is the best way to do it but do you think there is a way of solving this problem?

Thanks a lot for your help.

  • What I can see in the pictures is that you dont have any Employee selected in the slicer. I believe that is why the chart is empty. Once you select one employee it must work!

     

    I would also recomend you to format the slicer to Single Select only since you only want to analyse on employee at a time.

     

  • Hello id9213 ! I just realized what is the problem. 

    As it says in the microsoft page "You can't use implicit measures for now, so if you need an aggregated column as one of your fields, you need to create an explicit DAX measure for it."

     

    With this being said you need to creat a measure for each Employee like this:

     

    Employee1_Measure = SUM([Employee 1])

    ...

     

    Then create the field parameters again but use the measures instead of the columns.

     

    Let me know if it works 🙂

11 Replies

    • id9213's avatar
      id9213
      Helper I

      Thanks a lot JorgePinho !

      Really useful.

       

      I managed to create my list with the field parameters. I selected the fields in the original data and used it as values in the graph. Unfortunately, it does not seem to work (see graph on the right that is empty). Could it be because the origianl fields are sums?

      Thanks a lot for your help.

      • JorgePinho's avatar
        JorgePinho
        Solution Sage

        What I can see in the pictures is that you dont have any Employee selected in the slicer. I believe that is why the chart is empty. Once you select one employee it must work!

         

        I would also recomend you to format the slicer to Single Select only since you only want to analyse on employee at a time.

         

  • Hi JorgePinho 

     

    I am very happy with the results but I aiming to improve a bit my report.

    Do you think it would be possible to create cascading dropdowns where a first list would contain the grade of the employees and the second one, a restricted list with only the employeees with the corresponding grade and that would operate as the filter created above?
    I tried with Power Apps but it is not possible to integrate Power Apps it in my report.

    Thanks a lot for your answer.

    • JorgePinho's avatar
      JorgePinho
      Solution Sage

      Hello id9213 ! That looks like a great idea. However, I don't know how you can do it since that is a special slicer for the field parameters...

      • id9213's avatar
        id9213
        Helper I

        Unfortunately, this is what I thought.

        But I came up with an idea. I would have a simple list like that:

        Then I would have 4 different field parameters named the same way. I would create four different lists with each one of them.

         

        The idea would be to hide them, based on the choice you make in the list above.

        I know you can hide visuals thanks to a measure but I have issue making this. 

        Do you know how to apply a formula that will take into account the choice you make on the first list?

        Something like that?

         

        Thanks a lot for your help.