Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi Team,
Need help in SSAS tabular model
I am having one product table with the below details:
I have created one custom table in SSAS
DEFINE TABLE Ranges= DATATABLE (
"Ranges", STRING,
"Min Range", INTEGER,
"Max Range", INTEGER,
{
{"0-10", 0, 10 },
{ "10-30",10, 30 },
{ "30-60",30, 60 },
{ ">60",60, 100 }
}
)
EVALUATE Ranges
I need to get the range from range table based on the below condition
i
product[sales]>minrange && sales <max range then range
final output table:
Thanks In Advance
Solved! Go to Solution.
Hey @Anonymous ,
the following calculated column should do that:
Range =
VAR vRowSales = 'product table'[sales]
RETURN
CALCULATE(
MAX( Ranges[Ranges] ),
Ranges[Min Range] < vRowSales && vRowSales <= Ranges[Max Range]
)
Be aware that you are not clear with your definition of the beginning/endings of the ranges. As a user I would expect the sales of 10 to appear in both ranges (0-10 and 10-30) as both include 10.
Maybe you should do the ranges like 0-10, 11-30, 31-60, >60
Like this it would be clear in which range which number belongs to.
Hey @Anonymous ,
the following calculated column should do that:
Range =
VAR vRowSales = 'product table'[sales]
RETURN
CALCULATE(
MAX( Ranges[Ranges] ),
Ranges[Min Range] < vRowSales && vRowSales <= Ranges[Max Range]
)
Be aware that you are not clear with your definition of the beginning/endings of the ranges. As a user I would expect the sales of 10 to appear in both ranges (0-10 and 10-30) as both include 10.
Maybe you should do the ranges like 0-10, 11-30, 31-60, >60
Like this it would be clear in which range which number belongs to.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
6 | |
4 | |
3 | |
3 |
User | Count |
---|---|
13 | |
11 | |
8 | |
8 | |
8 |