COTH

How to Use the Power BI DAX function COTH

What is the COTH Function?

The COTH function is a mathematical function that calculates the hyperbolic cotangent of a given number. In simpler terms, it returns the inverse of the hyperbolic tangent of a number. The COTH function can be used to calculate the resistance of capacitors in an electrical circuit, or to model the spread of a disease over time.

In Power BI, the COTH function can be used to analyze data that exhibits exponential growth or decay over time. It is particularly useful when dealing with data that has a long tail, such as social media metrics or financial data.

Syntax and Arguments

The syntax of the COTH function is as follows:


COTH(number)


The only argument that the COTH function takes is a number, which can be a reference to a cell, a calculated column, or a measure in Power BI.

Examples

Let's take a look at some examples of how to use the COTH function in Power BI.

Example 1: Calculating the Resistance of Capacitors

Suppose we have a circuit that consists of two capacitors in series, each with a capacitance of 10 microfarads. The total resistance of the circuit can be calculated using the following formula:


R = 1 / (COTH(r1) + COTH(r2))


where `r1` and `r2` are the resistances of each capacitor.

To calculate the total resistance of the circuit using the COTH function in Power BI, we can create a calculated column with the following DAX formula:


Total Resistance = 1 / (COTH(10^(-6) * [Capacitance]) + COTH(10^(-6) * [Capacitance]))


Here, we are multiplying the capacitance by 10^(-6) to convert it to farads, and then using the COTH function to calculate the resistance of each capacitor.

Example 2: Modeling the Spread of a Disease

Suppose we have data on the spread of a disease over time, and we want to model its growth using the COTH function.

We can create a measure in Power BI that calculates the growth rate of the disease using the following DAX formula:


Growth Rate = (LN([Total Cases]) – LN([Previous Cases])) / [Days Since Previous Case]


Here, we are using the natural logarithm (LN) function to calculate the growth rate of the disease, based on the total number of cases and the number of days since the previous case.

To model the growth of the disease using the COTH function, we can create another measure with the following DAX formula:


Projected Cases = [Total Cases] * COTH(0.5 * [Growth Rate] * [Days Since First Case])


Here, we are using the COTH function to calculate the projected number of cases based on the growth rate and the number of days since the first case.

The COTH function is a powerful DAX function that can be used to analyze data that exhibits exponential growth or decay over time. In this article, we have explored what the COTH function is, how to use it, and some practical examples of its use in Power BI. Whether you are calculating the resistance of capacitors in an electrical circuit or modeling the spread of a disease, the COTH function can be an essential tool in your data analysis toolkit.

Power BI DAX Training Courses by G Com Solutions (0800 998 9248)

Upcoming Courses

15-17 July 2024
16-18 September 2024
11-13 November 2024

Contact Us

    Subject

    Your Name (required)

    Company/Organisation

    Email (required)

    Telephone

    Training Course(s)

    Your Message

    Upload Example Document(s) (Zip multiple files)