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
juanmontes
Frequent Visitor

Translate excel RATE function to DAX

Hi,

 

I've tried to use RATE function in DAX  like in Excel, but without success.  Some explanation about as I want to do:

 

I've the following data :

 

juanmontes_2-1656412598423.png

 

Could you help me to reproduce this function, please?

 

Thanks in advance,

 

Juan

 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Please follow these steps:

1. Pivot the table

vjianbolimsft_0-1656668112141.png

 

vjianbolimsft_1-1656668112144.png

 

2. Then change the data type of these values

vjianbolimsft_2-1656668112145.png

 

3. Create a Measure, here is the DAX:

 

FIELD =

VAR _a =

    SWITCH (

        MAX ( [Periodicity] ),

        "Monthly", 1,

        "Quarterly", 3,

        "Semiannual", 2,

        12

    )

VAR _b =

    SWITCH (

        MAX ( [Periodicity] ),

        "Monthly", 12,

        "Quarterly", 4,

        "Semiannual", 2,

        1

    )

VAR _r =

    RATE (

        DIVIDE ( MAX ( [Duration] ), _a ),

        MAX ( [Base] ) * MAX ( [COEFF] ),

        - MAX ( [Base] ),

        MAX ( [Residual Value] ),

        MAX ( [Arrear ->0 / Advance -> 1] )

    )

RETURN

IF ( ISBLANK ( MAX ( [COEFF] ) ), 0, _b * _r )

4. Change the format of the measure

 

vjianbolimsft_3-1656668112146.png

5. Apply it to a card

 

Final output:

vjianbolimsft_4-1656668112146.png

 

Best Regards,

Jianbo Li

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
v-jianboli-msft
Community Support
Community Support

Please follow these steps:

1. Pivot the table

vjianbolimsft_0-1656668112141.png

 

vjianbolimsft_1-1656668112144.png

 

2. Then change the data type of these values

vjianbolimsft_2-1656668112145.png

 

3. Create a Measure, here is the DAX:

 

FIELD =

VAR _a =

    SWITCH (

        MAX ( [Periodicity] ),

        "Monthly", 1,

        "Quarterly", 3,

        "Semiannual", 2,

        12

    )

VAR _b =

    SWITCH (

        MAX ( [Periodicity] ),

        "Monthly", 12,

        "Quarterly", 4,

        "Semiannual", 2,

        1

    )

VAR _r =

    RATE (

        DIVIDE ( MAX ( [Duration] ), _a ),

        MAX ( [Base] ) * MAX ( [COEFF] ),

        - MAX ( [Base] ),

        MAX ( [Residual Value] ),

        MAX ( [Arrear ->0 / Advance -> 1] )

    )

RETURN

IF ( ISBLANK ( MAX ( [COEFF] ) ), 0, _b * _r )

4. Change the format of the measure

 

vjianbolimsft_3-1656668112146.png

5. Apply it to a card

 

Final output:

vjianbolimsft_4-1656668112146.png

 

Best Regards,

Jianbo Li

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

amitchandak
Super User
Super User

@juanmontes , is this not one financial function supported?

https://www.youtube.com/watch?v=9VYqbj2h4zE

https://www.youtube.com/watch?v=6oaSdjZ_FLQ

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.