Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Create Table from measures

Hi,

 

I am having two different measures whcih calculate the no of task assigned and tasks delayed for difefrent projects . Both projects are having different data files with no relationship. No of engineers for projects may differ. However names will be mentioned in same format.

 

I want to create the following tables for each project and finally combine the tables as per engineer name. Kindly help.

 

Project 1

Engineer Name #Task Assigned # Task Delayed

A                                         3                           0

B                                         4                           1

C                                         1                           0

D                                        4                          2

E                                         1                           0

 

Project 2

 

 

Engineer Name #Task Assigned # Task Delayed

A                                         7                           2

B                                         6                           1

E                                         3                          0

 

 

OutPut Table

 

Engineer Name               Project 1 Task   Project 1 Task Delayed                Project 2 Task   Project 2 Task Delayed

A                                         3                           0                                                       7                             2

B                                         4                          1                                                        6                             1

C                                         1                           0                                                       0                             0

D                                        4                          2                                                        0                             0

E                                         1                           0                                                       3                            0

  • Hi, Anonymous ;

    Such as yogesh14june said, you could merge in power query.

    way 1. merge in power query.

    way 2: create a new table by dax.

    New table = 
    var _a=UNION(VALUES('Project 1'[Engineer Name]),VALUES('Project 2'[Engineer Name]))
    return  ADDCOLUMNS( SUMMARIZE(FILTER(_a,[Engineer Name]<>BLANK()),[Engineer Name]),
    "Project 1 Task", CALCULATE(SUM('Project 1'[#Task Assigned ]),FILTER('Project 1',[Engineer Name]=EARLIER('Project 1'[Engineer Name]))),
    "Project 1 Task Delayed", CALCULATE(SUM('Project 1'[#Task Assigned ]),FILTER('Project 1',[Engineer Name]=EARLIER('Project 1'[Engineer Name]))),
     "Project 2 Task",CALCULATE(SUM('Project 2'[#Task Assigned]),FILTER('Project 2',[Engineer Name]=EARLIER('Project 1'[Engineer Name]))),
     "Project 2 Task Delayed",CALCULATE(SUM('Project 2'[# Task Delayed]),FILTER('Project 2',[Engineer Name]=EARLIER('Project 1'[Engineer Name]))))

    the final show:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    You Can use merge queries from in power Query editor to unite the tables by the engineering names!

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, Anonymous ;

    Such as yogesh14june said, you could merge in power query.

    way 1. merge in power query.

    way 2: create a new table by dax.

    New table = 
    var _a=UNION(VALUES('Project 1'[Engineer Name]),VALUES('Project 2'[Engineer Name]))
    return  ADDCOLUMNS( SUMMARIZE(FILTER(_a,[Engineer Name]<>BLANK()),[Engineer Name]),
    "Project 1 Task", CALCULATE(SUM('Project 1'[#Task Assigned ]),FILTER('Project 1',[Engineer Name]=EARLIER('Project 1'[Engineer Name]))),
    "Project 1 Task Delayed", CALCULATE(SUM('Project 1'[#Task Assigned ]),FILTER('Project 1',[Engineer Name]=EARLIER('Project 1'[Engineer Name]))),
     "Project 2 Task",CALCULATE(SUM('Project 2'[#Task Assigned]),FILTER('Project 2',[Engineer Name]=EARLIER('Project 1'[Engineer Name]))),
     "Project 2 Task Delayed",CALCULATE(SUM('Project 2'[# Task Delayed]),FILTER('Project 2',[Engineer Name]=EARLIER('Project 1'[Engineer Name]))))

    the final show:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.