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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
jrobinson
Advocate IV
Advocate IV

Year to Date split by Period

Hi,

 

I need to create a measure in Power BI which calculates Sales Value for the Year to Date but split out by period. I've created the table I'm aiming for in Excel for clarification, and I'm having difficulty with the 'YTD' column:

 

example 2.png

 

 

Can anybody enlighten me? It's driving me mad. I have a good calendar table with dates in the format dd-mm-yyyy and also periods in the format yyyymm.

 

Thanks!

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

OK. That's why TOTALYTD is not working.

Try this then:

CALCULATE([Period],FILTER(ALL(Fact),Fact[Date]<=MAX(Fact[Date]) && Fact[Year]=MAX(Fact[Year]))

Michael

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Try YTD = TOTALYTD([Period],CalendarTable[Date])

Where [Period] is your usual "SUM" measure

 

This gives me the same values in my YTD measure as in my Period measure when I make the matrix table, with Period in columns, Company Name in rows, and Sales (Period) and Sales (YTD) (measures) in Values

Anonymous
Not applicable

1. Make sure you put a Period column from your Calendar table on columns 

2. Make sure you defined a relationship between Calendar Table and Fact table

3. If this doesn't work - send me a link to your .pbix file I'll take a look

Michael

I haven't had to use the calendar table in the end. I have a date column in my Sales table which aligns to the period i.e. 201601 = 01-01-2016. SO I don't actually use the calendar table at all. Only Sales (for prd), Sales (YTD), Date and CompanyName. When I put Date on columns it only shows me the years, nothing more granular

Anonymous
Not applicable

OK. That's why TOTALYTD is not working.

Try this then:

CALCULATE([Period],FILTER(ALL(Fact),Fact[Date]<=MAX(Fact[Date]) && Fact[Year]=MAX(Fact[Year]))

Michael

Thanks @Anonymous! Your formula largely gave me what I was looking for. In the end I've used the following formula to allow me to split out by company:

 

CALCULATE([Period],FILTER(ALLEXCEPT(Fact, Fact[CompanyName]),Fact[Date]<=MAX(Fact[Date ]) && Fact[Year]=MAX(Fact[Year])))

 

Thanks for your help!!

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.