cancel
Showing results for
Did you mean:
Highlighted Helper I

## Help with interest meassure over time

Hello all.

I have a bad time trying to get that DAX meassure and I need a hand so, I have this data and calcs in excel: The meassure I want to get is [Interest Total].

[Interest Total] = [Interest1] + [Interest2]

[Interest1] = (The SI function in IF function in spanish).

[Interest2] = Note: [Interest2] always SUM all the previous interest (1 and 2). Then affect with correspond rate to get the result.

[Year - Month]: is column in the calendar table with all the consecutive dates.

[Accumulated Profit], [Active Rate] and [Passive Rate] are a meassures.

I could calculate [Interest1] in a meassure (thinking in auxiliar meassure to get the total), but I can't figure out how get [Interest2)].

Any Ideas?

Regards,

JP

2 REPLIES 2
Highlighted Super User IV

## Re: Help with interest meassure over time

---------------------------------------

Putting square pegs in round holes since 1972.

##### I have a NEW book! DAX Cookbook from Packt
Over 120 DAX Recipes!

Proud to be a Super User!

Highlighted Helper I

## Re: Help with interest meassure over time

I'm struggling with this for days!

I write this meassure in Dax Studio:

``````EVALUATE
VAR Paso1 =
FILTER (
SUMMARIZE (
Calendario;
Calendario[idxFecha];
);
[R] <> BLANK ()
)
VAR Paso2 =
Paso1;
"IntR"; [R]
* IF ( [R] >= 0; [Tasa Pasiva]; [Tasa Activa] )
)
VAR Paso3 =
Paso2;
"Int2";
VAR Suma =
SUMX ( FILTER ( Paso2; [idxFecha] < EARLIER ( [idxFecha] ) ); [IntR] )
RETURN
Suma
* IF ( Suma >= 0; [Tasa Pasiva]; [Tasa Activa] )
)
VAR Paso4 =
Paso3;
"Int3";
VAR Suma =
SUMX ( FILTER ( Paso3; [idxFecha] < EARLIER ( [idxFecha] ) ); [Int2] )
RETURN
Suma
* IF ( Suma >= 0; [Tasa Pasiva]; [Tasa Activa] )
)
VAR Paso5 =
ADDCOLUMNS ( Paso4; "IntTotal"; [IntR] + [Int2] + [Int3] )
RETURN
Paso5``````

[IdxFecha] = Year * 100 + Day

This are the results: This are correct results for [IntTotal].

Now I wat go back to Power BI and.... So, the total is correct, but I lost my data lineage.

The meassure [Interes] is all the code at first, but the last line change to SUMX( Paso5; [IntTotal] ).

Any ideas?

Thanks!

Announcements #### Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members. #### Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start. #### Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries! Top Solution Authors
Top Kudoed Authors
Users online (966)