Forum Discussion

Zakaria_1980's avatar
Zakaria_1980
Icon for Post Patron rankPost Patron
6 years ago
Solved

Total scope per project and for all projects

Dears,

 

i've a table like this below:

 

 

 

based on the above data, i'd like to show me in my PBI report the following:

 

if I select project 1, total scope will be 78

if I select project 2, Total scope will be 100

if i select project 1 & 2, total scope will be 78+100

if I select all projects, it will be the sum of non dupplicated scopes

 

Thanks for your urgent support.

 

br,

  • Zakaria_1980 add this measure

     

    Total =
    SUMX ( VALUES ( Table[Project Name] ), CALCULATE ( MAX ( Table[Total Scope] ) ) ) 

     

    I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    ⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡

7 Replies

  • Zakaria_1980 add this measure

     

    Total =
    SUMX ( VALUES ( Table[Project Name] ), CALCULATE ( MAX ( Table[Total Scope] ) ) ) 

     

    I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    ⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡

    • Zakaria_1980's avatar
      Zakaria_1980
      Icon for Post Patron rankPost Patron

      can you explain  what does this funtion do please. i need to understand it.

      Thanks

      • parry2k's avatar
        parry2k
        Icon for Super User rankSuper User

        Zakaria_1980 sure, here is the breakup and if you need further information, please let me know.

        Total =
        SUMX ( --iterate over each row of the table and first parameter is a table, ans sum the value returned by 2nd parameter
        VALUES ( Table[Project Name] ), --this is a table on which sumx will iterage, VALUES function will return the unique list of project names (in other words, table of unique project name)
        CALCULATE ( MAX ( Table[Total Scope] )  --max function will return the MAX value of each project name, and we need to use CALCULATE the row filter context to get the max value
        ) 
        ) 

        I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

        ⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡