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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Split an interval of values to populate new column

I have a column of float values between 0 and 1. I would like to split the 0-1 interval into three parts, so the two thresholds should be 0.36 and 0.66. Each value of the column would then translate into a "low", "medium" or "high", depending on the interval in which it falls. These values would then populate a new column. The result should be something like

 

ValueClass
0.15Low
0.70High
0.41Medium

 

Bonus: what if I want to change the thresholds later, so that the interval is no longer splitted into three equal parts (they would still be three, but of different size)? How can I pass a modifiable threshold parameter to the function? 

4 REPLIES 4
FrankAT
Community Champion
Community Champion

Hi @Anonymous 

you can do it like this:

08-10-_2020_16-30-11.png

 

Interval = 
SWITCH(TRUE(),
    'Table'[Value] < 0.36, "Low",
    'Table'[Value] >= 0.36 && 'Table'[Value] < 0.66, "Medium",
    "High"
)

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Anonymous
Not applicable

Thanks a lot @FrankAT , it works flawlessly.

What about my last question? Do you know if there's an easy way to, let's say, put parameters in the function and set them from a visual? This is optional but I think it would improve the user experience.

hi  @Anonymous 

First, you should know that:

1. Calculation column/table not support dynamic changed based on filter or slicer.
2. Measure can be affected by filter/slicer, so you can use it to get dynamic summary result in a visual by its row context.

https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

 

Second, you create a measure and use what if parameter in it.

https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-what-if

 

by the way, measure is a dynamic summary  value, so it couldn't used a slicer or dim values.

 

Regards,

Lin

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

Hi @Anonymous 

At the moment I don't know of any way to pass a parameter to a calculated column via visual. Calculated columns are not dynamic.
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

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.