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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
sadhnabatra
Frequent Visitor

How to sum up a quantity based on a date Filter

I want to see sum of revenue field for dates less than the selected date in the filter . So for example if I have selected '6/30/2017' then I want to see sum of revenue for dates less than this.

Can anybody help me with a DAX for this?

Capture.PNG

 

1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

Hi @sadhnabatra,

 

According to your description above, you should be able to use the formula below to create a new measure to calculate the sum of revenue field for dates less than the selected date in the filter. Smiley Happy

Measure =
CALCULATE (
    SUM ( Table1[Revenue] ),
    FILTER ( ALL ( Table1 ), Table1[Date] <= MAX ( Table1[Date] ) )
)

 

Regards

View solution in original post

2 REPLIES 2
v-ljerr-msft
Employee
Employee

Hi @sadhnabatra,

 

According to your description above, you should be able to use the formula below to create a new measure to calculate the sum of revenue field for dates less than the selected date in the filter. Smiley Happy

Measure =
CALCULATE (
    SUM ( Table1[Revenue] ),
    FILTER ( ALL ( Table1 ), Table1[Date] <= MAX ( Table1[Date] ) )
)

 

Regards

Anonymous
Not applicable

Great! I want the filter to be were date = Max(date), how come that doesn't work and what can I do to get it to work? thanks!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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