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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Sum on a dynamic date range

Hello,

I would like to calculate the sum on a dynamic date range, for example:
For March 2019, the sum of material consumption must be:
= Sum of material consumption (April 2018 to March 2019)

Another example :
For September 2019, the sum of material consumption must be:
= Sum of material consumption (October 2018 to September 2019)

Please what is the DAX formula to meet this need?

Thank you.
Cordially.

1 ACCEPTED SOLUTION
joseluis1969
Frequent Visitor

Hello:

Try the following formula:

MAT cost:= calculate([Sum of material consumption],datesinperiod(calendar[date],lastdate(calendar[date]),-1,year))

Good luck,

José Luis

View solution in original post

3 REPLIES 3
joseluis1969
Frequent Visitor

Hello:

Try the following formula:

MAT cost:= calculate([Sum of material consumption],datesinperiod(calendar[date],lastdate(calendar[date]),-1,year))

Good luck,

José Luis

Anonymous
Not applicable

It worked perfectly for me. Thanks a lot!

Anonymous
Not applicable

Hello,

For this table in Power BI which consists of the fields (fields of the different tables), how to invert the rows in columns and the columns in rows?
You will find attached a screenshot of my table on Power BI.

I thank you in advance.
Cordially.eeee.png

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.