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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
m9820441
Frequent Visitor

Help on measure to get total of last day of last month

Hello, 

 

This is my first post, I read already a lot, but still fighting with measure. 

Situation : 

I have a table with aggregated values per day. 

2020-12-31   5

2022-01-01   10

2022-01-02   50

.

2022-01-31  100

2022-02-28   150

2022-03-31   180

 

What I need is a graph that shows the difference of each last day of the month compared with the last day of month before

So it should return

2022-01-31   95   (difference between 2021-12-31 and 2022-01-31)

2022-02-28   50   (difference between 2022-01-31 and 2022-02-28)

 

I tried with dateadd but I'm now able to find. also parallelperiod is giving me too much as I'm not interested in the sum of all values of last month, but ony value of last day of last month . 

Anyhow, solution is probably simple but I'm a bit stuck ... 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@m9820441 Use EOMONTH( <some date>, -1) function to return the end of the previous month's date.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi Greg, thx for your help already. 

I know the function, and seems I have all the pieces but I'd like some more guidance : 

This is what I tried : 

 

ValueMonth-1 =
 CALCULATE(sum(ONU[count]), FILTER(DateTable,DateTable[Date] = eomonth(DateTable[Date],-1)))
 
What I try to do is ge the sum of last day of last month next to the value of current month
 
So 
date                sum                                   sum(eomonth -1)                                               Diff
2022-01-31   <sum(ONU[count])>          <sum(ONU[count])> (2021-12-31)                   <col2> - < col1>

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.