cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Dax / Viz : Plus/Minus format and conditionnal formatting

Hi all

 

Considering a measure, I would like to :

  • Add + or - sign before the digits
  • Apply conditionnal formatting to the value (ex. red if negative, green if positive)

 

I can add + or - sign with myMeasure = FORMAT( [Foo]+[Bar] ; "+0.0%;-0.0%"), but it seems to convert the measure to string.
In this case, we can't use Conditionnal formatting with string (correct ?)

 

One very uggly solution should be to create 2 measures :

  • myMeasure1 = ... calculated ... , i.e wich type is numeric
  • myMeasure2 = FORMAT( myMeasure1; "+0.0%;-0.0%"), which type is string.

Then apply conditionnal formatting on myMeasure2 according to myMeasure1 value.

 

Is there a more efficient and elegant solution ?

 

Regards

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Dax / Viz : Plus/Minus format and conditionnal formatting

@jct999 , Try format option on a column in the Model view

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

1 REPLY 1
Highlighted
Super User IV
Super User IV

Re: Dax / Viz : Plus/Minus format and conditionnal formatting

@jct999 , Try format option on a column in the Model view

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors