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
ArchStanton
Post Prodigy
Post Prodigy

Cannot get YTD calculation to Sum

Hi,

 

I'm trying to SUM the values in the column called Count which is stored in a table called Deferrals. There is a column called Case StartDate within the Deferrals table but when I use that the Code fails completely, so I'm using the Createdon date column in another table that is related to the Deferrals table.

 

Sum of Deferrals = 
                        TOTALYTD(SUM(Deferrals[Count]),
                        'Cases'[createdon],
                        "31/03")

 

How can I SUM the values in Deferrals[Count)? 

 

FYI Count = 58

      SUM   = 60

 

I can only get 58 no matter what I try

 

Thanks,

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @ArchStanton 

 

Can you provide sample data for testing? Sensitive information can be removed in advance. You can also show it with pictures. I look forward to your response.

 

Best Regards,

Community Support Team _Charlotte

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

2 REPLIES 2
ArchStanton
Post Prodigy
Post Prodigy

Hi,

I realised that the Cases[createdon] date column did not contain a continous series of dates and there was no  relatationship with my Date2 calendar table. After some trial and error the following code has worked for me:

 

Cases Deferred2 YTD = CALCULATE(
                        TOTALYTD(SUM(Deferrals[Count]),
                        'Cases'[createdon],
                        USERELATIONSHIP(Date2[Date],'Cases'[createdon]),
                        "31/03"))
                        

 

This gives me the correct answer of 60.

 

Thanks for replying anyhow!

v-zhangti
Community Support
Community Support

Hi, @ArchStanton 

 

Can you provide sample data for testing? Sensitive information can be removed in advance. You can also show it with pictures. I look forward to your response.

 

Best Regards,

Community Support Team _Charlotte

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

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.