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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
srivally
Helper I
Helper I

Calculate YTD for duplicate dates

Hello Experts,

I am very new to PowerBI. I searched a lot to calculate YTD and came to know that we can calculate YTD only when we have distinct continous dates. But in my case I have multiple values for single date and I wanted to calculate YTD. I tried the following calculation
YTD = TOTALYTD(SUM('Sales'[Net Sales]),'Date'[Date]), but I'm getting same values as NetSales. It is not calculating YTD as we are having multiple values for single date. Here Sales is the main table and Date is Calendar table, I have created 1:1 relationship among Sales and Date table by  creating unique column and tried. But no luck as we are having multiple dates in Date table as well. Can anyone help me on this?

 

Thanks

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@srivally,

You date table doesn't contain all the possible date values of your sales table, and you don't create relationship between the two tables, thus you don't get expected YTD value.

Please check the attached PBIX file.


Regards,
Lydia

Community Support Team _ Lydia Zhang
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

14 REPLIES 14

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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