Forum Discussion
Anonymous
2 years agoNot applicable
Create new table using another table
Hi, I am trying to groupby a table and want to create new table from that: From the above dummy tableI want to create the below table 'AggregatedTable', "NoofTest" is count of all rows c...
- 2 years ago
Hi Anonymous ,
Based on the sample and description you provided, Please try code as below.
AggregatedTable = ADDCOLUMNS( GROUPBY( TABLENAME, TABLENAME[Source], TABLENAME[KPI], "NoofTest", COUNTX(CURRENTGROUP(),COUNTROWS(TABLENAME)) ), "PassTests", COUNTX(CALCULATETABLE(TABLENAME,TABLENAME[Difference]=0),COUNTROWS(TABLENAME)) )Result is as below.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-weiyan1-msft
Community Support
2 years agoHi Anonymous ,
Based on the sample and description you provided, Please try code as below.
AggregatedTable =
ADDCOLUMNS(
GROUPBY(
TABLENAME,
TABLENAME[Source],
TABLENAME[KPI],
"NoofTest", COUNTX(CURRENTGROUP(),COUNTROWS(TABLENAME))
),
"PassTests", COUNTX(CALCULATETABLE(TABLENAME,TABLENAME[Difference]=0),COUNTROWS(TABLENAME))
)
Result is as below.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous2 years agoNot applicable
It worked! Thanks