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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
erhan_79
Post Prodigy
Post Prodigy

Measure Help

Hi there;

 

I need your little help, I have a table like as below I need to calculate with a measure only the sum of the amount of the current month and previous month

For the below example , as you see current month and previous dates are signed with yellow , and i need to capture total amount " 300" 

 

But pls don't forget the main thing when you open the report, the system will compare the date of the opening report and find the amount of the current month and Previous month's amounts .

 

I Hope it's clear, thanks in advance

 

 

caps1.JPG

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@erhan_79 

Try below measure:

Measure = 

CALCULATE(
    SUM(Table1[Amount]),
    FILTER( ALL(Table1[Date]) , 
        Table1[Date] <= EOMONTH(TODAY(),0)
    )
)

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

7 REPLIES 7
Fowmy
Super User
Super User

@erhan_79 

Try below measure:

Measure = 

CALCULATE(
    SUM(Table1[Amount]),
    FILTER( ALL(Table1[Date]) , 
        Table1[Date] <= EOMONTH(TODAY(),0)
    )
)

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

thank you very much @Fowmy 

AllisonKennedy
Community Champion
Community Champion

@erhan_79  I'm not sure I understand your question - are you trying to find a cumulative sum of everything including this month and before? Do you have a DimDate table? You will need one with a Date data type column, and month column.

https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html

 

There are a few options here. You could filter this with a relative date slicer or use an explicit measure with filter inside the measure, such as: 

 

AmountToDate =

CALCULATE(SUM(Table[Amount]), MONTH(DimDate[Date]) <= MONTH(TODAY()) && YEAR(DimDate[Date]) = YEAR(TODAY()) )

 

 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

dear @AllisonKennedy  ;

 

i dont have dim dat table , i am working on a live data so i can not create dim date .Is not possible to solve without Dimdate ?

 

yes ı am  trying to find a cumulative sum of everything including this month and before

 

thanks 

 

 

@erhan_79 , Yes it is possible without date table, just use the Date column from your table instead of DimDate table. Note my solution assumes you only want data from this year. See the solution from @Fowmy  for a more elegant solution if you want ALL data from all previous years up to this month.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

amitchandak
Super User
Super User

@erhan_79 , One way with date table, cumulative till last month

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=maxx(date,dateadd(date[date]),-1,month)))

 

or last few months

Rolling 6 till last 1 month = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(dateadd(Sales[Sales Date],-1,month)),-6,MONTH))

 

and this month

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

dear @amitchandak ;

 

can you check below formula , could be something wrong ? , something is not working.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.