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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Calculate total price based on three conditions

Hi,

 

I would like to make a calculation for finding the price based on amount of people.

If count ParticipantID is 0-2500 then 3 USD

and count of ParticipantID 2500-20000 then 4 USD

and count of ParticipantID above 20000 then 5 USD

 

I have a ParticipntID-field where I can make a count and then the prices are like stated above.

 

Can someone help me making a measure calculating the total price based on the amount of participants?

 

Thank you!

 

Examples below

1st example:

25000 participants then the price would be:

2500 * 3 USD = 7500 USD

17500 * 4 USD = 70000 USD

5000 * 5 USD = 25000 USD

total =  7500 + 70000 + 25000 = 102500 USD


2nd example:

5000 participants then the price would be:

2500 * 3 USD = 7500 USD

2500 * 4 USD = 10000 USD

Total = 7500 + 10000 = 17500 USD

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

Parameter – 1 to 25000

vyangliumsft_0-1637719222969.png

Here are the steps you can follow:

1. Create calculated column.

price =
SWITCH(
    TRUE(),
    'Table'[Parameter]>=0&&'Table'[Parameter]<=2500,3,
    'Table'[Parameter]>0&&'Table'[Parameter]<=20000,4,
    'Table'[Parameter]>20000,5)
amount of participants =
var _2500=
COUNTX(FILTER(ALL('Table'),'Table'[Parameter]>=0&&'Table'[Parameter]<=2500),[Parameter]) * CALCULATE(MAX('Table'[price]),FILTER(ALL('Table'),'Table'[Parameter]>=0&&'Table'[Parameter]<=2500))

var _20000=
COUNTX(FILTER(ALL('Table'),'Table'[Parameter]>2500&&'Table'[Parameter]<=20000),[Parameter]) * CALCULATE(MAX('Table'[price]),FILTER(ALL('Table'),'Table'[Parameter]>2500&&'Table'[Parameter]<20000))

var _more200000=
COUNTX(FILTER(ALL('Table'),'Table'[Parameter]>20000),[Parameter]) * CALCULATE(MAX('Table'[price]),FILTER(ALL('Table'),'Table'[Parameter]>20000))

return
_2500+_20000+_more200000

2. Result:

vyangliumsft_1-1637719222971.png

 

Best Regards,

Liu Yang

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

4 REPLIES 4
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

Parameter – 1 to 25000

vyangliumsft_0-1637719222969.png

Here are the steps you can follow:

1. Create calculated column.

price =
SWITCH(
    TRUE(),
    'Table'[Parameter]>=0&&'Table'[Parameter]<=2500,3,
    'Table'[Parameter]>0&&'Table'[Parameter]<=20000,4,
    'Table'[Parameter]>20000,5)
amount of participants =
var _2500=
COUNTX(FILTER(ALL('Table'),'Table'[Parameter]>=0&&'Table'[Parameter]<=2500),[Parameter]) * CALCULATE(MAX('Table'[price]),FILTER(ALL('Table'),'Table'[Parameter]>=0&&'Table'[Parameter]<=2500))

var _20000=
COUNTX(FILTER(ALL('Table'),'Table'[Parameter]>2500&&'Table'[Parameter]<=20000),[Parameter]) * CALCULATE(MAX('Table'[price]),FILTER(ALL('Table'),'Table'[Parameter]>2500&&'Table'[Parameter]<20000))

var _more200000=
COUNTX(FILTER(ALL('Table'),'Table'[Parameter]>20000),[Parameter]) * CALCULATE(MAX('Table'[price]),FILTER(ALL('Table'),'Table'[Parameter]>20000))

return
_2500+_20000+_more200000

2. Result:

vyangliumsft_1-1637719222971.png

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

Thank you very much! That worked 🙂

amitchandak
Super User
Super User

@Anonymous , if the count of participants is a measure then you need to try binning/ bucketing 

 

refer if this can help

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

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
Anonymous
Not applicable

Hi amitchandak,

 

Thank you for your response.

 

I have seen your link but I don't think that fits here as well? I am not looking for a bucketing but instead a calculation for the price based on the amount of three buckets. I might be wrong though?

 

In case you believe the bucket can be used for the calculation your help would be much appreciated. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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