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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

Progression calculation

Hello everyone!

 

The Brazilian government has adopted a progressive table for the collection of social security contributions. The rates are as follows.

 

Contribution SalaryRate
Until R$ 1.045,007,5%
From R$ 1.045,01 to R$ 2.089,609%
From R$ 2.089,61 to R$ 3.134,4012%
From R$ 3.134,41 to R$ 6.101,0614%

 

Between each installment, the calculation is made considering the maximum and minimum of these and the rate to be applied. While the salary amount is not reached, it is considered the salary cap.

Here's how is the calculation for a salary of R$ 3,000.00 as an example, which is in the third track:

- 1st salary range: 1,045.00 x 0.075 = 78.38
- 2nd salary range: [2,089.60 - 1,045.00] x 0.09 = 1,044.60 x 0.09 = 94.01
- Salary range: [3,000.00 - 2,089.60] x 0.12 = 910.40 x 0.12 = 109.25
- Total to be collected: 109.25 + 94.01 + 78.38 = 281.64

With this result it is possible to calculate the effective rate that is about 9.39% (281.64 ÷ 3,000.00).

 

So, i would like to create a measure capable of doing this calculation. Can someone help me please?

 

Thank you!

 

Luis

3 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@Anonymous - You basically need to implement a WHILE loop in DAX, here is how: https://community.powerbi.com/t5/Quick-Measures-Gallery/While-Loop/m-p/637535#M320



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Anonymous
Not applicable

HI @Anonymous,

Please split your contribution salary to two fields based on 'to' character and remove others not used text strings, then you can write a measure formula to calculate on them.

Measure = 
VAR summary =
    SUMMARIZE (
        'Table',
        [Contribution Salary From],
        [Contribution Salary To],
        [Rate],
        "Result", ( [Contribution Salary To] - [Contribution Salary From] ) * [rate]
    )
RETURN
    SUMX ( summary, [Result] )

5.png

Regards,

Xiaoxin Sheng

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

You may refer to my solution - Compute transaction fee based on a tiered pricing model.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

You may refer to my solution - Compute transaction fee based on a tiered pricing model.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

HI @Anonymous,

Please split your contribution salary to two fields based on 'to' character and remove others not used text strings, then you can write a measure formula to calculate on them.

Measure = 
VAR summary =
    SUMMARIZE (
        'Table',
        [Contribution Salary From],
        [Contribution Salary To],
        [Rate],
        "Result", ( [Contribution Salary To] - [Contribution Salary From] ) * [rate]
    )
RETURN
    SUMX ( summary, [Result] )

5.png

Regards,

Xiaoxin Sheng

Asac_14
Resolver I
Resolver I

Hi @Anonymous  Here is the measure to compute effective rate - 

Effective Rate =
Var Sal=SUM('Salary'[Salary])
Var Total=IF(Sal>3134.41,(1045*0.075)+(1044.60*0.09)+(1044.79*0.12)+(Sal-3134.41)*0.14,IF(Sal>2089.61,(1045*0.075)+(1044.60*0.09)+(Sal-2089.61)*0.12,IF(Sal>1045.01,(1045*0.075)+(Sal-1045.01)*0.09,(Sal-1045)*0.75)))
Return
DIVIDE(Total,Sal)
 

ScreenshotScreenshot

Replace with your table and field name. Pls accept it as solution if it solves your problem. Kudos are welcome as well 😉

 

Thanks & Regards,

KK

+91-9940-28-4669

Greg_Deckler
Community Champion
Community Champion

@Anonymous - You basically need to implement a WHILE loop in DAX, here is how: https://community.powerbi.com/t5/Quick-Measures-Gallery/While-Loop/m-p/637535#M320



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.