Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Error on Subtracting two measures having format

Hi PaulDBrown  and @all,

Here is one more Issue i am facing. I think you can fix this. 
Continuing to the link below.
https://community.powerbi.com/t5/Desktop/sign-currency-for-only-few-rows-based-upon-condition/m-p/946863/highlight/false#M453719

 

I have subtracted two measures and applied in matrix which gives me an error as shown in the screenshot.
Change = [January] - [February]

 

  • Hi Anonymous ,

     

    We can try to use the following measure to meet your requirement:

     

    Change =
    VALUE (
        SUBSTITUTE (
            [January Total] & "",
            "$",
            ""
        )
    )
        - VALUE (
            SUBSTITUTE (
                [February Total] & "",
                "$",
                ""
            )
        )

     

    If it does not work, could you please share the formula of [Janury Total] and [February Total] if it does not contain any confidential information?


    Best regards,

     

13 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Icon for Community Champion rankCommunity Champion

    Anonymous 

     

    Make sure that all columns and measures used in the calculations are formatted as some sort of number (not "general" nor "text" etc..)

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for reply PaulDBrown 

      The calculation used for Change are measures [January Total] and [February Total] which have the same data type as shown in below screenshot.

       Change = [January Total] - [February Total] 

      Still results in same error.  Is there any thing else I am missing ?

      • santiagomur's avatar
        santiagomur
        Icon for Resolver II rankResolver II

        i think some of the columns you use to calculate january total or february total is txt or some are date and other numeric.