cancel
Showing results for
Did you mean:
Highlighted
Frequent Visitor

YTD Calculation not working

Hi,

I am starting to learn Power BI and i am stuck while doing YTD calculation.

I linked 2 tables. Table 1: Customer name, Ordered Date, Revenue

Table 2: Created a DIM Table

NEW DIMTABLE = CALENDAR(DATE(2018,1,1),DATE(2019,12,31))

I linked these 2 tables using many to 1 relationship. When I do the YTD revenue it is gicing me the SUM amount, not the YTD revenue. Can you please help?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

Re: YTD Calculation not working

Hey,

this seems odd ...

Here you will find a sample pbix file

The Revenue YTD measure looks like yours:

```Revenue YTD =
TOTALYTD(SUM('Fact'[Revenue]),'Calendar'[Date]) ```

Please check your relationships, the relationships look like this:

And my sample data looks like this:

Hopefully this proivides you with the necessary hint.

Regards,

Tom

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
3 REPLIES 3
Super User

Re: YTD Calculation not working

Hey,

please provide the exact formula of your YTD calculation.

Besides that, maybe you want to have a look at this site: https://www.daxpatterns.com/time-patterns/

Regards,

Tom

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
Frequent Visitor

Re: YTD Calculation not working

Hi Tom,

Thanks for the fast reply.

YTD Revenue = TOTALYTD(sum(Data[Revenue]),'NEW DIMTABLE'[Date])

Super User

Re: YTD Calculation not working

Hey,

this seems odd ...

Here you will find a sample pbix file

The Revenue YTD measure looks like yours:

```Revenue YTD =
TOTALYTD(SUM('Fact'[Revenue]),'Calendar'[Date]) ```

Please check your relationships, the relationships look like this:

And my sample data looks like this:

Hopefully this proivides you with the necessary hint.

Regards,

Tom

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!