cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Frequent Visitor

## Calculating sum of value with filter on date and year as legend

Hi

I want to see the year-to-date sales amount per customer and year in a column chart. I used this formula

CALCULATE(
sum(UnifiedData[value]),
VALUES(UnifiedData[Year]),
filter( UnifiedData,UnifiedData[delivery day customer]<today()  )
)
Where value is the sale amount, I have the customer in my X axis and the year as a legend. The formula returns the correct value for the current year, but for last years, It's cumulative with the current year, and I don't know how to limit it per year.
Thanks
1 ACCEPTED SOLUTION
Community Support

Hi @parissap ,

The table data is shown below:

1. Use the following DAX expression to create a measure named ‘SumSales ’

SumSales =
CALCULATE (
SUM ( UnifiedData[value] ),
FILTER ( 'UnifiedData', 'UnifiedData'[delivery day customer] < TODAY () )
)

2. Use the 'Year' column to create a slicer

3. Final output

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

Community Support

Hi @parissap ,

The table data is shown below:

1. Use the following DAX expression to create a measure named ‘SumSales ’

SumSales =
CALCULATE (
SUM ( UnifiedData[value] ),
FILTER ( 'UnifiedData', 'UnifiedData'[delivery day customer] < TODAY () )
)

2. Use the 'Year' column to create a slicer

3. Final output

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

Announcements

#### Fabric certifications survey

Certification feedback opportunity for the community.

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors