Daily DAX : Day 175 DOLLARDE

 In Power BI, the DAX (Data Analysis Expressions) function DOLLARDE is used to convert a fractional dollar price (e.g., a price expressed in dollars and fractions like 1.25, where 0.25 represents a fraction of a dollar) into a decimal dollar amount. This is particularly useful in financial contexts, such as bond pricing or stock market data, where prices are often quoted in fractional form (e.g., 1 1/4 dollars or 1.25 in a base-32 system).

Syntax

DAX


DOLLARDE(fractional_dollar, fraction)


    fractional_dollar: The number representing the dollar amount in fractional format (e.g., 1.25, where 1 is the whole dollar and 0.25 is the fraction).

    fraction: The denominator of the fraction (e.g., 4 for quarters, 8 for eighths, 32 for thirty-seconds). This specifies the base of the fractional part.


How It Works

The DOLLARDE function takes the fractional part of the fractional_dollar and converts it into a decimal based on the specified fraction. For example:


    If the fractional dollar is 1.25 and the fraction is 4, it interprets 0.25 as 25/100 of a dollar in base 4 (quarters), converting it to 1 + (25/100) = 1.25 dollars.

    In financial markets, however, fractions often represent a different base (like 32nds), so the function adjusts accordingly.


The formula it uses internally is:


DOLLARDE = whole_dollars + (fractional_part / fraction)


Where:


    whole_dollars is the integer part of fractional_dollar.

    fractional_part is the decimal part multiplied by the fraction denominator.


Return Value

The function returns a decimal number representing the full dollar amount.

Example Use Case

Suppose you're working with bond price data in Power BI, and the prices are quoted in thirty-seconds (a common convention in bond markets). A bond price might be listed as 99.16, where 99 is the whole dollar amount and 0.16 represents 16/32 of a dollar.

DAX Formula

DAX


BondPriceDecimal = DOLLARDE(99.16, 32)


Calculation


    Whole dollars = 99

    Fractional part = 0.16 (16/32 of a dollar)

    Conversion: 16 ÷ 32 = 0.5

    Result: 99 + 0.5 = 99.5


So, DOLLARDE(99.16, 32) returns 99.5, which is the decimal equivalent of the bond price.

Practical Use Case


    Financial Reporting: Analysts working with legacy financial data (e.g., stock or bond prices in fractional form) can use DOLLARDE to convert these into decimal values for easier calculations, charting, or comparisons in Power BI.

    Data Transformation: If you're importing data from a source that uses fractional pricing (e.g., 100.08 meaning 100 and 8/32), DOLLARDE standardizes it into a decimal format (100.25 in this case) for consistency.

    Historical Data Analysis: Older financial datasets often use fractional notation, and this function bridges that gap for modern analysis.


Notes


    The counterpart to DOLLARDE is DOLLARFR, which converts a decimal dollar amount back into a fractional format.

    Ensure the fraction argument matches the convention of your data (e.g., 4 for quarters, 8 for eighths, 32 for thirty-seconds) to avoid misinterpretation.


In summary, DOLLARDE is a niche but powerful function for financial data transformation in Power BI, making it easier to work with fractional pricing in a decimal-based system.

Comments

Popular posts from this blog

Daily DAX : Day 131 SELECTEDMEASURE

Daily DAX : Day 446 INFO.CSDLMETADATA

Daily DAX : Day 453 ENDOFWEEK