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
bw70316
Helper V
Helper V

DAX Returning only One Value instead of all

I have a budgetary report I have been working on and I have been working to get the Expenditure by Month by using the following equation:


Expensed Measure = SUM(Table1[Expensed])

Per Month total = CALCULATE([Expensed Measure],DATEADD(Table1[Exp Date],-1,MONTH))
 
Monthly Totals = [Expensed Measure]-[Per Month total]

This yields:

dazaroony.png

If change it to -2 I only get the correct data for September. How do I get ALL of the data? I have tried inputting an ALL funtion but can't figure it out. Also, I was able to get this to work with raw data, which means there could be something corrupted in my PBI report file?
2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@bw70316,

 

Try using PREVIOUSMONTH instead of DATEADD and take a look at https://www.sqlbi.com/articles/filter-arguments-in-calculate/.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
dedelman_clng
Community Champion
Community Champion

DATEADD(Table1[Exp Date],-1,MONTH) against Aug 31, 2018 literally brings back July 31, 2018, which you don't have in your dataset.

 

Create a calendar table ( DateTab = CALENDARAUTO() ) if you don't have one, and create a 1-to-many relationship between it and Exp Date.

 

Then use PREVIOUSMONTH()

 

Per Month total = CALCULATE([Expensed Measure], PREVIOUSMONTH(DateTab[Date]) )

 

If that doesn't work, please provide a sample of your raw data.

 

Hope this helps

David

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors