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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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


@Anonymous 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.


@Anonymous

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
Ashish_Mathur
Super User
Super User

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/
novelties2017
New Member

 
Vvelarde
Community Champion
Community Champion

@Anonymous

 

Hi try with this:

 

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

 

Regards

 

Victor

Lima -peru




Lima - Peru
Anonymous
Not applicable

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.


@Anonymous 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.


@Anonymous

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors