Power Bi Cant subtract percentage

Viewed 53

How do I subtract percentages in Power BI? Cant get it to work.

Measure1 = 1
Measure2 = 0.9
Measure3 = [Measure1] - [Measure2]

This ofcourse works fine, but when I try to format my measures to show everything in percentages, I get the "Cannot convert value 100% of type Text to type Number"-Error when I try to visualize Measeure3 with the below code.

Measure1 = Format(1,"0.0%")
Measure2 = Format(0.9,"0.0%")
Measure3 = [Measure1] - [Measure2]

How do i calculate and visualize this easy formula when the figures are formated as percentages?

2 Answers

Actually you need to do the formatting after subtraction operation: Like this:

Measure3 = FORMAT((1 - 0.9),"0.0%")

On a visual Card,

Visual Formatting Section

Note: Format() Function returns a text as a result, not a number.

TestIfText_Measure3 = ISTEXT('Measure Table'[Measure3])

Test

You need smth like that

VALUE(LEFT( [Measure1],LEN( [Measure1])-1)) - VALUE(LEFT( [Measure2],LEN( [Measure2])-1))
Related