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

How To Create a Table with Ranges based on starting value

I want to make a visual table that will show Min/Max ranges in a table for different tiers.

 

So I am needing to start with a value...  Let's say it's 7500 (and this value will change and will not be constant)..

7500 will start the 5th tier... To find the range , I will add 7500 to the number to find the max, and subtract 7500 to find the minimum for that tier..  

 

Subsequent tiers below tier 5 will have 15000 subtracted from the Minimum value of tier 5, to "fill in the blank" for tier 4, another -15000 to find the min value of tier 3, etc...

Tiers above tier 5 will have +15000 added to each minimum..

 

Jazzyfey11_0-1632877859544.png

Is there a way to create a table that will be able to visualize the min/max of each tier dynamically as the main value will change (the original 7500)?

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download PBIX file with the following code.

 

You can do this in Power Query with this code

 

 

let 
    n = 7500,
    n2 = n*2
in 
#table
(
    type table 
    [
        #"Minimum" = number,
        #"Maximum" = number,
        #"Tier" = number
    ],
    {
        {-9999999, n2*-3, 1},
        {(n2*-3)-0.01, n2*-2, 2},
        {(n2*-2)-0.01, n2*-1, 3},
        {(n2*-1)-0.01, 0, 4},
        {0.01, n2, 5},
        {n2+0.01, n2*2, 6},
        {(n2*2)+0.01, n2*3, 7},
        {(n2*3)+0.01, n2*4, 8},
        {(n2*4)+0.01, 9999999, 9}
    }
)

 

 

 

Which creates this

stattab.png

 

I'm not sure how you intend to get the value 7500 (or whatever it is) into the code but for now I've typed it in.  This value can be loaded via other means.

 

You could do this in DAX using the Table Constructor

 

Table constructor - DAX | Microsoft Docs

 

but you can't name the columns using that approach.  I'd go with the Power Query solution as it's more flexible.

 

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

1 REPLY 1
PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download PBIX file with the following code.

 

You can do this in Power Query with this code

 

 

let 
    n = 7500,
    n2 = n*2
in 
#table
(
    type table 
    [
        #"Minimum" = number,
        #"Maximum" = number,
        #"Tier" = number
    ],
    {
        {-9999999, n2*-3, 1},
        {(n2*-3)-0.01, n2*-2, 2},
        {(n2*-2)-0.01, n2*-1, 3},
        {(n2*-1)-0.01, 0, 4},
        {0.01, n2, 5},
        {n2+0.01, n2*2, 6},
        {(n2*2)+0.01, n2*3, 7},
        {(n2*3)+0.01, n2*4, 8},
        {(n2*4)+0.01, 9999999, 9}
    }
)

 

 

 

Which creates this

stattab.png

 

I'm not sure how you intend to get the value 7500 (or whatever it is) into the code but for now I've typed it in.  This value can be loaded via other means.

 

You could do this in DAX using the Table Constructor

 

Table constructor - DAX | Microsoft Docs

 

but you can't name the columns using that approach.  I'd go with the Power Query solution as it's more flexible.

 

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


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.