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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.