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