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!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.

Power BI Desktop August 2020 Update

Power BI Desktop August 2020 Update

We have great updates this month! Click the link for the video with more info.

Top Solution Authors
Top Kudoed Authors