Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
NilR
Post Patron
Post Patron

Multiple Conditional Formatting with diff Data Formats

I need help on Conditional Formatting!
I have a measure with multiple Data formats Such as ( Number, Currency, and Percent) . I would like to setup conditional formating to show any value negative in Red and Any value >= 0 in Green.

However, at the bottom you can see that My First Number that is not Currency "0,00" and the Last one is Percent "0.00%" they stayed black . Is there any way to change those numbers  into Red  if they are Negative or Green if >=1 ?

 

 

Financial Variance = IFERROR(SWITCH(TRUE(),
SELECTEDVALUE('III - Financial Metrics'[Financial Metrics])="Member Months", FORMAT([Member Months]-[Member Months_ALL_BVS],"0,00"),
SELECTEDVALUE('III - Financial Metrics'[Financial Metrics])="PMPM", [PMPM]-[PMPM_ALL_BVS],
SELECTEDVALUE('III - Financial Metrics'[Financial Metrics])="PEPM", [PEPM]-[PEPM_ALL_BVS],
SELECTEDVALUE('III - Financial Metrics'[Financial Metrics])="Revenue", [Premium (Revenue)] -[Premium_ALL_BVS],
SELECTEDVALUE('III - Financial Metrics'[Financial Metrics])="Pricing Policy", FIXED(0,"Standard"),
SELECTEDVALUE('III - Financial Metrics'[Financial Metrics])="Medical Claims", [MEDICAL CLAIMS] - [MEDICAL_CLAIMS_ALL_BVS],
SELECTEDVALUE('III - Financial Metrics'[Financial Metrics])="Pharmacy Claims", [RX CLAIMS] - [RX_CLAIMS_ALL_BVS],
SELECTEDVALUE('III - Financial Metrics'[Financial Metrics])="MLR", FORMAT([MLR] - [MLR_ALL_BVS] ,"0.00%"),
SELECTEDVALUE('III - Financial Metrics'[Financial Metrics])="Capitation", [TOTAL_CAP] - [TOTAL_CAP_ALL_BVS],0),0)

 

 

 

NilR_0-1646976574214.png

My Conditional Formatting:

NilR_2-1646976920717.png

My result:

NilR_1-1646976813735.png

 

Desired Result:

Untitled.png
Thanks!
1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @NilR ;

I found the type of Financial Variance is text because here use FORMAT().

so if coniditonal format is rules, may be cause error. I think you could create other measure as Color based on a calculation.

Such as:

Measure = IF(CONTAINSSTRING([Financial Variance],"%"),"Green",IF([Financial Variance]=0,"Black","Red"))

vyalanwumsft_0-1647325580334.png

The final output is shown below:

vyalanwumsft_1-1647325607182.png

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yalanwu-msft
Community Support
Community Support

Hi, @NilR ;

I found the type of Financial Variance is text because here use FORMAT().

so if coniditonal format is rules, may be cause error. I think you could create other measure as Color based on a calculation.

Such as:

Measure = IF(CONTAINSSTRING([Financial Variance],"%"),"Green",IF([Financial Variance]=0,"Black","Red"))

vyalanwumsft_0-1647325580334.png

The final output is shown below:

vyalanwumsft_1-1647325607182.png

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you very much! 🙂

amitchandak
Super User
Super User

@NilR , The last Percent , should be number

 

Also you can try color measure

 

How to do conditional formatting by measure and apply it on pie? : https://youtu.be/RqBb5eBf_I4

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

I am not coloring my metrics, I want to color them if it is negative then turn RED or if it is positive Then Green.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.