cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
seroskij Frequent Visitor
Frequent Visitor

Create Measure to Sum Up Column Total Based on User Picking Date

I'm trying to write a measure that sums up the entire column based on a user picking a date on a slicer. 

 

This is what I have so far: 

 

CalculatePastDue = CALCULATE(SUM(Invoice[AmtUSD]),FILTER(Invoice,Invoice[PaidDate] <= RELATED(DateTable[Date])))

 

However, it's not summing the total of the column. It's only summing up the value for that one particular date. 

 

Capture2.PNGCapture.PNGCapture2.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator Eric_Zhang
Moderator

Re: Create Measure to Sum Up Column Total Based on User Picking Date


@seroskij wrote:

Thank you for replying. For some reason it's adding a lot more values (6.8 M). I added the data table into the original question for a frame of reference.


@seroskij

What is the date column in the slicer? @Vvelarde's DAX shall work based on my test. Alternatively, you can create a measure as simple as sumTotal = SUM(Invoice[AmtUSD]) and use "BEFORE" in the slicer. See attached pbix file.

Capture.PNG

 

For further suggestion, please post upload the pbix file. You can upload it to Onedrive/GoogleDrive and share the download link. Do remember to mask sensitive data before uploading.

View solution in original post

5 REPLIES 5
Highlighted
Vvelarde Super Contributor
Super Contributor

Re: Create Measure to Sum Up Column Total Based on User Picking Date

@seroskij

 

Hi try with this:

 

CalculatePastDue = CALCULATE(SUM(Invoice[AmtUSD]),FILTER(All(Invoice),Invoice[PaidDate] <= SELECTEDVALUE(DateTable[Date])))

 

Regards

 

Victor

Lima -peru




Lima - Peru
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




seroskij Frequent Visitor
Frequent Visitor

Re: Create Measure to Sum Up Column Total Based on User Picking Date

Thank you for replying. For some reason it's adding a lot more values (6.8 M). I added the data table into the original question for a frame of reference.

novelties2017 Frequent Visitor
Frequent Visitor

Re: Create Measure to Sum Up Column Total Based on User Picking Date

 
Moderator Eric_Zhang
Moderator

Re: Create Measure to Sum Up Column Total Based on User Picking Date


@seroskij wrote:

Thank you for replying. For some reason it's adding a lot more values (6.8 M). I added the data table into the original question for a frame of reference.


@seroskij

What is the date column in the slicer? @Vvelarde's DAX shall work based on my test. Alternatively, you can create a measure as simple as sumTotal = SUM(Invoice[AmtUSD]) and use "BEFORE" in the slicer. See attached pbix file.

Capture.PNG

 

For further suggestion, please post upload the pbix file. You can upload it to Onedrive/GoogleDrive and share the download link. Do remember to mask sensitive data before uploading.

View solution in original post

Super User IV
Super User IV

Re: Create Measure to Sum Up Column Total Based on User Picking Date

Hi,

 

Create a relationship from the PaidDate column in the Invoice table to the Date column in the DateTable table.  In the visual, drag the Date column from the DateTable table.  Now try this formula

 

=CALCULATE(SUM(Invoice[AmtUSD]),FILTER(Invoice,Invoice[PaidDate] <= MAX(DateTable[Date])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors