cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
joc Regular Visitor
Regular Visitor

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 :

 

Sans titre.png 

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

 

Thanks a lot for your help,

Joc

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Add new table with calculated lines

Hi @joc,

 

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

Summary Table = 
ADDCOLUMNS(
    ADDCOLUMNS(
        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])

9.PNG

 

 

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 = 
ADDCOLUMNS(
    ADDCOLUMNS(
        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 Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
2 REPLIES 2
Community Support Team
Community Support Team

Re: Add new table with calculated lines

Hi @joc,

 

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

Summary Table = 
ADDCOLUMNS(
    ADDCOLUMNS(
        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])

9.PNG

 

 

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 = 
ADDCOLUMNS(
    ADDCOLUMNS(
        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 Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
joc Regular Visitor
Regular Visitor

Re: Add new table with calculated lines

Perfect thanks a lot !

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 206 members 2,257 guests
Please welcome our newest community members: