DAX Linear Interpolation

joeshu26

Board Regular
Joined
Oct 30, 2013
Messages
136
Hello,

One table is a "lookup" table that contains probabilities and scores. The other is a "fact" table with scores and a column for probabilities. I am looking for a DAX measure that will return the correct probability by linearly interpolating the score in the "fact" table to the "lookup" table...


ProbabilityScore
.01
14.58
.0212.12
.0310.75
.049.83
.059.16
.068.65
.078.23
.087.88
.097.59
.107.34
.117.12
.106.93

<tbody>
</tbody>

IdentifierIDGroupSizeScore
1A100009.5
2A84007.25
3A60008.499
4A30009.2124
5B450012.43
6B220011.689
7C48007.231
8C33008.82
9C860010.3
10C50009.9930
11D110010.6510
12D180013.4

<tbody>
</tbody>
 
This is great Ozeroth! Yeah I was getting stuck on using MIN as filter argument and was also mixing up syntax when I tried to use combinations of TOPN and FILTER with FIRSTNONBLANK. All 3 options you provided increased performance for me by significant amounts. I've been using DAX Studio as well as SQL Server Profiler to analyze query results. Though I'm still a newbie when it comes to reading and optimizing DAX query plans. Here are DAX Studio timings:

Previous Solution:
Total: 296ms , SE CPU: 125ms x0.9 , FE: 156ms 52.7% , SE: 140ms 47.3% , SE Queries: 10 , SE Cache: 2 20.0%

Updated Solutions:
1. Total: 203ms , SE CPU: 110ms x0.7 , FE: 46ms 22.7% , SE: 157ms 77.3% , SE Queries: 10 , SE Cache: 2 20.0%
2. Total: 203ms , SE CPU: 125ms x1.0 , FE: 78ms 38.4% , SE: 125ms 61.6% , SE Queries: 10 , SE Cache: 2 20.0%
3. Total: 218ms , SE CPU: 126ms x0.8 , FE: 61ms 28.0% , SE: 157ms 72.0% , SE Queries: 12 , SE Cache: 3 20.0%

Note my fact table is around 3 million rows, so I'm not sure if that's why storage engine is not running in parallel across cores (not sure if SE CPU only running up to x1.0 because 3 million rows is under 8 million row segment) or if it's because of the settings of the slow server hardware I'm running it on.
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,215,343
Messages
6,124,402
Members
449,156
Latest member
LSchleppi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top