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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
GilesWalker
Skilled Sharer
Skilled Sharer

YTD up to month selected help

Hi Everyone,

 

I am having a major issue trying to figure this one out. I have a table with sales data (volume, $, and dates) I also have a seperate DateKey table. What I am trying to get is if a user selects one particular month in a filter that a measure will calculate the sum of sales for that month and all proceeding sales to the start of the year.

 

Everything I try keeps giving me the wrong stuff so hopefully you great people will have a simple answer.

 

Thanks,

 

Giles

6 REPLIES 6
SammiP
Regular Visitor

Hi Giles,

 

Did you ever figure this out?  The YTD solution mthat people gave here, does the YTD for each month and then grows because it is like a cumulative total.  What Giles and I wanted was the Actuals for each month and then if the user selects April.  The April column will Have April's Data (NOT CUMULATIVE OR YTD) and in the Total Column the YTD from Jan - April.

 

I need help.

Sean
Community Champion
Community Champion

@GilesWalker

Have you tried using TOTALYTD

Without any sample data...

YTD Measure =
TOTALYTD (
    SUMX ( TableName, TableName[Volumne] * TableName[Price] ),
    CalendarTable[Date]
)

Then if you have Year and Month slicers it should work! Smiley Happy

If no Year is selected it will default to current year up to selected month and if no month is selected up to date!

If Year is selected and no month it will give you total for the year and if a month is also selected YTD for the selected year!

@Sean thanks for the response. I inputted the below DAX formula:

 

 YTD test = TOTALYTD(

SUMX ( Table1,  [Actual residual]  ),

DimDate[Date]

)

The measure [Actual Residual] is SUM (Table1[Dollars]) - basically it just sums the total revenue.

 

With your formula if I select a month the result is the same as [Actual Residual] it doesnt do a YTD total. If no months are selected your formula result is less than [Actual Residual]

 

Any thoughts?

 

Thanks,

 

Giles

 

Sean
Community Champion
Community Champion

Since you already have a Measure - How about this?
YTD test = TOTALYTD(
[Actual residual],
DimDate[Date]
)

@Sean - That was the first measure I tried, the issue is if I pick a month in the filter the YTD figure and the [Actual Residual] measure are the same, the TOTALYTD doesn't appear to do what it should.

 

One thing I have noticed is the TOTALYTD figure when no month is selected but the year is selected, the totals are different. My understanding of TOTALYTD is that it takes into account outside filters, is that correct?

@Sean, Hey did you get it working? I also have the same situation. My MTD, YTD works flawlessely. However, if I select multiple months in filter say June,July,Aug for Year 2018; my YTD shows YTD till AUG, which should show SUM of MTD b/w June till Aug only.

 

If I select these months on row or columns axis, my YTD shows the bifurcation correctly. However same doesnt work if I get months as filter axis.

 

Any 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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

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