Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
XaviOV
Helper V
Helper V

Add by filtering by the date of a column

Hello

I have two tables one with the date values (unique) and another table with date values (repeated) and with different values that I want to sum based on the date and the column of "line" excluding line 4.

Example:

Suma line.png Suma plts.png

Best regards!

1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hi @XaviOV ,

 

Just create calculated column in table1:

 

 

column =
CALCULATE (
    SUM ( 'Table2'[plts] ),
    FILTER (
        'Table2',
        'Table2'[Week] = EARLIER ( 'Table1'[Week] )
            && 'Table2'[line] <> 4
    )
)

 

 

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

 

Best Regards,

Dedmon Dai

View solution in original post

3 REPLIES 3
v-deddai1-msft
Community Support
Community Support

Hi @XaviOV ,

 

Just create calculated column in table1:

 

 

column =
CALCULATE (
    SUM ( 'Table2'[plts] ),
    FILTER (
        'Table2',
        'Table2'[Week] = EARLIER ( 'Table1'[Week] )
            && 'Table2'[line] <> 4
    )
)

 

 

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

 

Best Regards,

Dedmon Dai

amitchandak
Super User
Super User

@XaviOV , Not very clear,

you can join both of the tables, if dates are unique in table 2 .you can join them together and analyze. Or join to common date table and analyze 

In such case

use measure = calculate(sum(Table1[pits]), filter(Table1,Table1[line]<>4))

 

if you want table2 from table1

table 2 = summarize( Table, Table[Week], "Suma plts",calculate(sum(Table1[pits]), filter(Table1,Table1[line]<>4)))

 

if you want new column in table2 from table 1

New column in table 2 = sumx(filter(Table1,Table1[line]<>4 && Table1[week] = Table2[week]),sum(Table1[pits]))

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Fowmy
Super User
Super User

@XaviOV 

Go to Modeling Table > New Table and Paste the following code, it will create anew table with the result as you expect.

Table5 Summarized = 

SUMMARIZE(
    FILTER(Table5,Table5[line]<>4),
    Table5[Week],
    "Total", SUM(Table5[plts])
)

Fowmy_0-1599733709856.png

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 



 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.