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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
espinozan
Helper I
Helper I

YTD Revenue Calculation

Hi everyone,

 

I'm trying to create a measure in my report that calculates YTD Revenue but somehow I can't get it to do what I'm looking for. I have data ranging from Jan 2016 to Apr 2017. My measure is not giving me the correct numbers. 

YTD Revenue = TOTALYTD([Total Sales],'Calendar'[Date])YTD Rev.PNG
1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @espinozan,

 

It seems that it's something wrong with the report. The "year" context should always be there with function "TOTALYTD". Have a look at the example in the picture. The "TotalYTD" will accumulate in one year (2007). And it will start from 0 in the next year.

 

You have data of two years. So the result will be wrong if there is only a month context. Please try to create a report as the picture showed. 

 

YTD Revenue Calculation .jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @espinozan,

 

It seems that it's something wrong with the report. The "year" context should always be there with function "TOTALYTD". Have a look at the example in the picture. The "TotalYTD" will accumulate in one year (2007). And it will start from 0 in the next year.

 

You have data of two years. So the result will be wrong if there is only a month context. Please try to create a report as the picture showed. 

 

YTD Revenue Calculation .jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-jiascu-msft,

 

This helps alot, thank you. But is there to do a continuing YTD? Meaning it gives me a running sum for 12 months prior to today's date.

 

 

Hi @espinozan,

 

Could you please tell me if your problem was resolved? Could you please share the answer or mark the proper answer as solution if it's convenient for you? That will be a help to the others.

Best Regards!
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @espinozan,

 

Yes, YTD is continuing for 12 months. The third parameter decides the end of the 12 months. Have a look at this formula. It starts from "07-25" to "07-24" of the next year. (but we can't use today())

TotalYTD =
TOTALYTD (
    SUMX ( Sales, Sales[Quantity] * Sales[Unit Price] ),
    'Date'[Date],
    "07-24"
)

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors