Forum Discussion

ADSL's avatar
ADSL
Post Prodigy
2 years ago
Solved

MoM% Showing the Infinity Value

Hi BI Community Team,   I have a sales order table and looking for MTD, PMTD & MoM Growth % with measure below that I explore and apply.   MTD-Sales = TOTALMTD(SUM('Sales Order'[Amt]), 'CALENDAR'...
  • pmreis's avatar
    2 years ago

    Hi ADSL ,

    This typically occurs when you divide a number by zero. In this case, the problem arises when the [PMTD-Sales] measure returns a value of 0, which is then used as the denominator in your MoM-Sales calculation.

    Try something like this:

     

    MoM-Sales = 
    VAR CurrentMonthSales = [MTD-Sales]
    VAR PreviousMonthSales = [PMTD-Sales]
    RETURN
    IF(
        PreviousMonthSales = 0,
        BLANK(),
        (CurrentMonthSales - PreviousMonthSales) / PreviousMonthSales
    )

     

    For reference on error handling in DAX formulas: DAX error reference


    Pedro Reis - Data Platform MVP / MCT
    Making Power BI and Fabric Simple

    If my response resolved your issue, please mark it as a solution to help others find it. If you found it helpful, please consider giving it a kudos. Your feedback is highly appreciated!

    Find me at LinkedIn