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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
ArchStanton
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Power BI Header Change

Power BI Header Update

Read about the exciting updates for the Power BI forum.