Compare values from Ranges Table in SSAS Tabular Model DAX

Sahoo 46 Reputation points

Hi Team,

I am having one table with below details

and i am defining one table in ssas for Ranges

TABLE Ranges =
"Ranges", STRING,
"Min Range", INTEGER,
"Max Range", INTEGER,
{ "0-10", 0, 10 },
{ "10-30", 10, 30 },
{ "30-60", 30, 60 },
{ ">60", 60, 100 }


Final output:


Ranges should compare with min and max range from ranges tables . These two table doesn't have relationships.

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,249 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Alexei Stoyanovsky 3,416 Reputation points

    Apparently you want a calculated column in your one table. Here's one way of coding it:

    Range = 
    var pct = 'one table'[Sales Percentage]
    return CALCULATE(SELECTEDVALUE('Ranges'[Ranges], "no single match"),'Ranges'[Min Range] < pct, 'Ranges'[Max Range] >= pct)

    As a side note you might want to tweak the labels for your ranges so it's apparent which boundaries are inclusive and which are exclusive.

    0 comments No comments