Forum Discussion

IF's avatar
IF
Post Prodigy
5 years ago
Solved

substract with decimal

Hi, I want to substract between two measures and colour the result. For example; Measure1 Measure2 Rounded Measure1 Rounded Measure2 Difference 0.196 0.204 0.20 0.20 0 0.191 0.204...
  • lbendlin's avatar
    5 years ago

    You can use a simpler approach. Your Measure3 can directly compute the desired RGB color, and then your conditional formatting can use the value of Measure3 directly as well (rather than rules)

  • Fowmy's avatar
    5 years ago

    IF 

     

    Use Measure 3  as the measure for the conditional formatting as follows:

    ________________________

    If my answer was helpful, please click Accept it as the solution to help other members find it useful

    Click on the Thumbs-Up icon if you like this reply šŸ™‚


    Website YouTube  LinkedIn

     

  • v-robertq-msft's avatar
    5 years ago

    Hi, IF 

    According to your description and picture, I guess that you want to get the difference of the round value of the two measures and set conditional format based on their difference, you can try my steps:

    1. I suggest you to use DAX to get the round value of the two measures, you can create these measures:
    Rounded Measure1 = ROUND([Measure1],2)
    Rounded Measure2 = ROUND([Measure2],2)
    Measure3 = [Rounded Measure1]-[Rounded Measure2]
    Color =
    
    SWITCH(
    
        TRUE(),
    
        [Measure3]=0,"Green",
    
        [Measure3]<0,"Red",
    
        [Measure3]>0,"Black")
    1. Then create a table chart and place columns and open the conditional format, like this:

     

    1. Then set the conditional format like this:

     

    And you can get what you want.

    You can download my test pbix file here

     

    If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

    How to Get Your Question Answered Quickly 

     

    Best Regards,

    Community Support Team _Robert Qin

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • IF's avatar
    IF
    5 years ago

    Yes, I thought of using a card to change the color accordingly. Thanks a lot! Happy holidays!