Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago

Measure by specific project (simliar to group by in SQL)

Hello to all

 

I have a perfectly graphic that show all the values sum by project, but in two project I need to show the break down in the graph.

 

This can be done by using a measure that adds only values in a specific filter?

 

Any help would be necessary.

 

Thanks

2 Replies

  • dkay84_PowerBI's avatar
    dkay84_PowerBI
    Icon for Microsoft Employee rankMicrosoft Employee

    Are the two projects' names/id static?  If so, you could add a FILTER() arguement to your measure where Table[Column] = "Project Name" and then have your customized measure.

     

    If your measure needs to be dynamic and only apply this filter to the specific projects, you could use a SWITCH() or IF() statement to identify when the Project Name is present in the row level context and then it would apply the calculation from above using the Filter arguement.

     

    If you provide sample data it would be easier to answer.

    • Anonymous's avatar
      Anonymous
      Not applicable

      I have something like:

      Table 1

      IdActivity  Project

      1                 P1

      2                 P1

      3                 P2

      4                 P2

      5                 P2

      6                 P3

       

      Table 2

      Id   IdActivity Value  Person

      1    1               20      1

      2    1               25      2

      2    2               20      2

      2    3               5        3

      2    1               25      4

       

      What I need to to add the Value for the activities of P2 but show the rest of the activities separated.

       

      I tried a FILTER has you suggested but.. It gives me no value. This could be because I'm filtering using table 1 on a measure on table 2.. (it seems dumb I know... )