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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
superjam
Helper II
Helper II

Problems with a YTD calculation

Hello.

 

I have three tables:

1. Movimientos, among others, with the following columns:

- date

- amt1

- amt2

- amt3

There may be multiple lines for the same date, with different amt values.

 

2. Calendar, the usual one, with the "date" column

 

3. Measures, with the following column (very simple!), among others, and working fine:

calc = Movimientos[amt1] + Movimientos [amt2] - Movimientos[amt3]

 

The tables "Movimientos" and "Calendar" have an active relationship, connecting the columns "date" and "date".

 

I made a simple table visual, with months in the rows and numbers and calc in values, like so:

 

dateamt1amt2amt3calc
jan105114
feb2061115
mar3072116

 

Until here, everything works fine.

 

What I need is the YTD of "calc", so I did a measure like the following:

calc YTD = TOTALYTD( calc, calendar[date] ).

 

Strangely, I obtained something like this:

 

datecalccalc YTD
jan1414
feb1534
mar1664

 

So, the first month is OK. For the next month, it adds the first argument (amt1) of the "calc" formula, instead of adding the result of that formula. The same for the following months. Does this make sense?

 

Why is this happening? 

 

Thank you and regards.

 

 

2 REPLIES 2
superjam
Helper II
Helper II

Hi @CoreyP 

 

Thank you for your help. The SUMX thing actually worked, ...in part.

The YTD calculation is now correct. This part is corrected!!

 

But, now a little problem appeared in the calculation for the "calc" measure: if some values of amt1, amt2, or amt3 is blank, then the end result is also blank.

 

I suppose this happens, because for some months, there is no register for some amt values. I mean, for example, there is no line of february with amt2.

 

Is there a way to correct this?

 

Thank you again and regards.

CoreyP
Solution Sage
Solution Sage

I feel like this could be a SUMX thing. So, instead of calc = amt1 + amt2 - amt3, try calc = SUMX( Movimientos, amt1 + amt2 - amt3 )

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors