cancel
Showing results for
Did you mean:
Highlighted
Helper I

## Add new table with calculated lines

Hello everybody,

I need your help to create a new table with conditions. I know how to create a new table, but don't what is the formula to calculated what I want :

I have the first table, and I want the new one.

Thanks a lot for your help,

Joc

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support

## Re: Add new table with calculated lines

Hi @joc,

You can use below table formula to summary original table records:

```Summary Table =
SUMMARIZE('Test Table',[Week],"Col 1",SUMX(FILTER('Test Table',[Week]=EARLIER('Test Table'[Week])&&OR('Test Table'[Name]="A",'Test Table'[Name]="B")),[Value])),
"Col 2",[Col 1]+[Col 1]/2),
"Col 3",[Col 1]-[Col 2])```

Based on your result table, you 'col2' formula should be "A+B+(C+D)/2", right?
If this is a case, you can use below formula to instead:

```Summary Table =
SUMMARIZE('Test Table',[Week],"Col 1",SUMX(FILTER('Test Table',[Week]=EARLIER('Test Table'[Week])&&OR('Test Table'[Name]="A",'Test Table'[Name]="B")),[Value])),
"Col 2",[Col 1]+(SUMX(FILTER('Test Table',[Week]=EARLIER('Test Table'[Week])),[Value])-[Col 1])/2),
"Col 3",[Col 1]-[Col 2])```

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
2 REPLIES 2
Highlighted
Community Support

## Re: Add new table with calculated lines

Hi @joc,

You can use below table formula to summary original table records:

```Summary Table =
SUMMARIZE('Test Table',[Week],"Col 1",SUMX(FILTER('Test Table',[Week]=EARLIER('Test Table'[Week])&&OR('Test Table'[Name]="A",'Test Table'[Name]="B")),[Value])),
"Col 2",[Col 1]+[Col 1]/2),
"Col 3",[Col 1]-[Col 2])```

Based on your result table, you 'col2' formula should be "A+B+(C+D)/2", right?
If this is a case, you can use below formula to instead:

```Summary Table =
SUMMARIZE('Test Table',[Week],"Col 1",SUMX(FILTER('Test Table',[Week]=EARLIER('Test Table'[Week])&&OR('Test Table'[Name]="A",'Test Table'[Name]="B")),[Value])),
"Col 2",[Col 1]+(SUMX(FILTER('Test Table',[Week]=EARLIER('Test Table'[Week])),[Value])-[Col 1])/2),
"Col 3",[Col 1]-[Col 2])```

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Helper I

## Re: Add new table with calculated lines

Perfect thanks a lot !

Announcements

#### Microsoft Ignite

This will be a conference that you do not want to miss!

#### Get Ready for Power BI Dev Camp

Don't miss the Power BI Dev Camp this week!

#### August Community Highlights

Check out a full recap of the month!

#### August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

#### Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors