Student T-distribution in DAX

Pierrecl3

New Member
Joined
Jul 26, 2017
Messages
18
Hello everyone,

I would like to use the Student T density function & cumulative probability function in a measure related to a data table in PivotTable Fields.
Excel has it with T.DIST(..., ..., FALSE/TRUE). However is it a more or less straightforward to use an equivalent in DAX?

Thanks in advance for your insights! :)
 
Last edited:

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
I update my post because this is not the density function but the inverse of the cumulative one I do need to compute:

I would like to use the Student T cumulative distribution function & its inverse function in a measure related to a data table in PivotTable Fields.
Excel has a T CDF with T.DIST(..., ..., TRUE) and its inverse with T.INV. However is it a more or less straightforward to use an equivalent in DAX?

Thanks in advance for your insights! :)
 
Upvote 0
I reformulate my post again because of typing errors (sorry):

I update my post because this is not the density function but the inverse of the cumulative one I do need to compute:

I would like to use Student T cumulative distribution function & its inverse function in a measure related to a data table in PivotTable Fields.
Excel has a T CDF with T.DIST(..., ..., TRUE) and its inverse with T.INV. However is there any more or less straightforward way to use an equivalent in DAX?

Thanks in advance for your insights! :smile:
 
Upvote 0
Hi Pierrecl3,

You can calculate the t-distribution inverse CDF (same as Excel's T.INV) using CONFIDENCE.T.
Here is one way I came up with but there could be better methods. Just replace the red text with appropriate expressions returning the probability & degrees of freedom.

Code:
<expression returning="" probability=""><expression returning="" degrees="" of="" freedom="">T_CDF_Inv =
VAR Prob = [COLOR=#ff0000][B][Expression returning input probability][/B][/COLOR]
VAR DegFreedom =[COLOR=#ff0000][B] [Expression returning input degrees of freedom][/B][/COLOR]
VAR SampleSize = DegFreedom + 1
RETURN
    IF (
        Prob = 0.5,
        0,
        IF (
            AND ( Prob > 0.5, Prob < 1 ),
            CONFIDENCE.T ( 2 - 2 * Prob, 1, SampleSize ),
            IF ( AND ( Prob > 0, Prob < 0.5 ), - CONFIDENCE.T ( 2 * Prob, 1, SampleSize ) )
        )
    )
        * SQRT ( SampleSize )

Not sure how to calculate the CDF itself.

You could always resort to importing pre-computed tables, and interpolating as needed.

Hopefully Microsoft adds these functions some time!

Owen :)</expression></expression>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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