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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
ribaldo
Frequent Visitor

Calculate quarter as difference between YTD months

Hi all.

I've data stored in my database as YTD values, and YTD data are not a sum of months.

I'm looking for a way to calculate quaters not as an aggregation of months but as a difference between YTD values of the last month of the quarter.

Fo example:

     Expeted Result
YearQuarterMonthSales YTD AmtSales Amt 
2021 January1010 
  February2313 
  March3412 
 Q1  3534
  April4711 
  May6014 
  June7313 
 Q2  3839

 

Any ideas?

 

2 REPLIES 2
ribaldo
Frequent Visitor

@amitchandak , I've some trouble implementing your solution. I'm using tabular with compatibility level 1400, and don't have isinscope function. I tried hasonevalue, but without success.

amitchandak
Super User
Super User

@ribaldo , You need a measure like this

 

if(isinscope(Date[Qtr]) && Not(isinscope(Date[Month])) , [sales YTD] - calculate([sales] -datesmtd( Date[Date])), blank())

 

Assuming you are using date table and time intelligence

 


YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))

 

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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.