Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Multi-condition table

Hello PBI community, I have a problem which requires (re)building a table with multiple columns based on multiple conditions per column.   Problem statement: - I have a database which contains mu...
  • v-zhangti's avatar
    3 years ago

    Hi, Anonymous 

     

    You can try the following methods.

    Table = SUMMARIZE('Source table','Source table'[Project name],'Source table'[Proj Mgr.])

    Column:

    1 - Concept = CALCULATE(MIN('Source table'[Date]),FILTER('Source table',[To Stage]="1 - Concept"&&[Project name]=EARLIER('Table'[Project name])))
    2 - Feasibility = CALCULATE(MIN('Source table'[Date]),FILTER('Source table',[To Stage]="2 - Feasibility"&&[Project name]=EARLIER('Table'[Project name])))
    Days in Concept = [2 - Feasibility]-[1 - Concept]

    Change the column format to integer.

    3 - Execution = CALCULATE(MIN('Source table'[Date]),FILTER('Source table',[To Stage]="3 - Execution"&&[Project name]=EARLIER('Table'[Project name])))
    Days in Feasibility = [3 - Execution]-[2 - Feasibility]
    4 - Closure = CALCULATE(MIN('Source table'[Date]),FILTER('Source table',[To Stage]="4 - Closure"&&[Project name]=EARLIER('Table'[Project name])))
    Days in Execution = [4 - Closure]-[3 - Execution]
    Completed = CALCULATE(MIN('Source table'[Date]),FILTER('Source table',[To Stage]="Completed"&&[Project name]=EARLIER('Table'[Project name])))
    Days in Closure = [Completed]-[4 - Closure]

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

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