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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vsteinly
Frequent Visitor

Tiered Rates

I want to create a charge amount based on a tiered rate structure.  I found a model out there created by Victor Acquach (if you are still out there I would love to see your response) and built my model just like what he had in his.  With some stuggle I am now getting a total charge but it is only going through the first tier to calculate.  Here is the tiered rates that I am workin with for my example.

 

TypeUsage BandUsage FromUsage ToRateDate FromDate To$Amount 
COMM1 to 60600   4.605/1/20164/30/2017                -  the first 600 units
COMM7 to 506005000   5.095/1/20164/30/2017         27.60next 4400 units
COMM51 to 951500099500   4.295/1/20164/30/2017      223.96next 94500 units
COMM> 100099500999999   3.035/1/20164/30/2017   4,054.05over 1,000,000
COMM1 to 60600   4.635/1/20174/30/2018                -   
COMM7 to 506005000   5.145/1/20174/30/2018         27.78 
COMM51 to 951500099500   4.405/1/20174/30/2018      226.16 
COMM> 100099500999999   3.055/1/20174/30/2018   4,158.00 

 

Here is the calculated field:  

 

Charge =
CALCULATE (
CALCULATE (
( SUM ( Summary[Qty-100CCF] ) - MAX ( RatesTable[USAGE FROM] ) )
* MAX ( RatesTable[RATE] )
+ MAX ( RatesTable[$Amount] ),
FILTER (
RatesTable,
SUM ( Summary[Qty-100CCF] ) < RatesTable[USAGE TO]
&& SUM ( Summary[Qty-100CCF] ) >= RatesTable[USAGE FROM]
),
FILTER (
RatesTable,
max(Summary[RunDate]) < RatesTable[DATE TO]
&& max(Summary[RunDate]) >= RatesTable[DATE FROM]
)
),
FILTER (
ALL ( 'Calendar' ),
Calendar[MonthID] = MAX ( Calendar[MonthID] )
&& Calendar[Date] <= MAX ( Calendar[Date] )
)
)

 

Any suggestiion are welcome.

3 REPLIES 3
v-xjiin-msft
Solution Sage
Solution Sage

Hi @vsteinly,

 

Could you please share us your pbix file with One Drive or Google Drive if possible? So that I can dig deeper and make some proper tests.

 

Also, please share us your expected result. It will help us get the right direction.

 

Thanks,
Xi Jin.

Have you looked at my model?

So I realized I didn't put enough information in my request.  We are a Water utility and have a tiered rate structure is based on consumption of water.  Each fiscal year our rates change.  Below is what the end result would be looking at two different fiscal years and the rates being charges.

 

 

 May 1, 2016 to April 30, 2017  
  5,500CCF
Tier 1First 600 cubic feet at $4.60 per 100 cubic feet       27.60 
Tier 2Next 4,400 cubic feet at $5.09 per 100 cubic feet     223.96 
Tier 3Next 995,000 cubic feet at $4.29 per 100 cubic feet       21.45 
Tier 4Over 1,000,000 cubic feet at $3.03 per 100 cubic feet  
  273.01Total charged
    
 May 1, 2017 to April 30, 2018  
  5,500CCF
Tier 1First 600 cubic feet at $4.63 per 100 cubic feet       27.78 
Tier 2Next 4,400 cubic feet at $5.14 per 100 cubic feet     226.16 
Tier 3Next 995,000 cubic feet at $4.40 per 100 cubic feet       22.00 
Tier 4Over 1,000,000 cubic feet at $3.05 per 100 cubic feet  
  275.94Total charged
    

 

The result I'm seeing is all consumption coming back using the May 1, 2017 to April 30, 2018 Tier 1 rate (4.63).

 

 https://drive.google.com/open?id=1XyNwimc0TjFjVw_jmzKO_SgXHF7MluwC

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.