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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
parissap
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. 
Please help me.
 Thanks
1 ACCEPTED SOLUTION
v-zhouwen-msft
Community Support
Community Support

Hi @parissap ,

The table data is shown below:

vzhouwenmsft_0-1708397364153.png

Please follow these steps:
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

vzhouwenmsft_0-1708397462885.png

 

vzhouwenmsft_1-1708397470655.png

3. Final output

vzhouwenmsft_2-1708397499727.png

 

vzhouwenmsft_3-1708397509680.png

vzhouwenmsft_4-1708397518112.png

vzhouwenmsft_5-1708397522983.png

 

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.

 

View solution in original post

1 REPLY 1
v-zhouwen-msft
Community Support
Community Support

Hi @parissap ,

The table data is shown below:

vzhouwenmsft_0-1708397364153.png

Please follow these steps:
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

vzhouwenmsft_0-1708397462885.png

 

vzhouwenmsft_1-1708397470655.png

3. Final output

vzhouwenmsft_2-1708397499727.png

 

vzhouwenmsft_3-1708397509680.png

vzhouwenmsft_4-1708397518112.png

vzhouwenmsft_5-1708397522983.png

 

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.

 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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