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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
BI_user2023
Frequent Visitor

Need help with a DAX formula (sum of quantities between each pair of dates from a list of dates)

Hi everyone,

 

Could someone assist me with a DAX formula?

Firstly, I have the following data model:

BI_user2023_0-1692350351658.png

 

 

I possess a Date table that enables me to define a date range using a slicer.

I maintain a list of articles, named "Articles," with "cod_art" as the primary key.

I also have a list of sales, named "Sales," which is linked to the "Articles" table via the "cod_art" field, along with two other fields indicating the sales quantity and date.

Additionally, there's a final table named "Article_price_list," detailing price variations for each article. This table is connected to the "Articles" table through the "cod_art" field, providing the article's price and the effective date of that price.

My objective is to create the following matrix:

BI_user2023_1-1692350351659.png

 

 

 

I can set a date range, and within this range, the matrix will display the effective date for each article. However, what I'm struggling with is creating a DAX formula to calculate the sum of quantities sold for each effective date (i have to calculate the actual number of the sum, not the whole text in the above image).

I would greatly appreciate it if someone could offer their assistance with this matter.

Thank you very much!

1 REPLY 1
Anonymous
Not applicable

Hi @BI_user2023 

You can use sumx function.

e.g 

Measure=SUMX(Article,[price]*[quantity]))

If the function cannot meet your requirement,  can you provide some sample data or file so that can provide more useful suggestion for you.

 

Best Regards!

Yolo Zhu

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

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.