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
dataskience
New Member

MTD, QTD and YTD slicers on cumulative values

i have a dataset as follows.

Month  ParticularsAmount
Jan-24Sales100
Feb-24Sales220
Mar-24Sales350
Jan-24cogs80
Feb-24cogs170
Mar-24cogs240
Jan-24Salary70
Feb-24Salary135
Mar-24Salary255

 

All the values are cumulative.

When i select MTD for the month of mar'24, i want values of mar'24 - feb '24. for examp-le, sales for march'24 is 350-220.

when i select QTD, i want values of Mar'24 alone since it is cumulative. if the period is till Jun'24, then QTD selection should be Jun'24-Mar'24.

 

Can anyone help me with DAX and if possible upload a sample power bi file.

Can anyone help me with dax formula, please.

3 REPLIES 3
Rupak_bi
Super User
Super User

Rupak_bi_0-1712753554484.pngRupak_bi_1-1712753579730.png

Hope this fulfills your ask. You may use same concept in quarter calculation as MTD going forward.



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/
Greg_Deckler
Community Champion
Community Champion

@dataskience It may be easier for you to add a calculated column that gives you the monthly values first and then standard patterns will work. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395....
The basic pattern is:
Column = 
  VAR __Current = [Value]
  VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])

  VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
 ( __Current - __Previous ) * 1.



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

Thanks for your reply.

since there are many line items and multiple columns, the values are not calculated correctly.

Can you please provide a formula that will consider the value based on other column values also.

please 

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.