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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
ChrisR22
Helper III
Helper III

Conditional Formatting

Hello,

 

I have two visuals, tables, in which there are calculation/measures. What i'd like to do is create conditional formatting so that if two specific cells, one in each table, show the same value, they appear as green, and if they vary, they appear as red. 

 

For example:

 

Fund 1

NAV

$40,500,000
Beginning Balance$40,316,213
Ending Balance$40,461,335

 

Fund 2

NAV

$40,500,000
Beginning Balance$40,316,213
Ending Balance$40,461,335

 

 

If NAVs are both the same, we'd like them both to show as green.

 

Alternatively, if there isn't a way to do this, then It would suffice to have a card or some other visual that said 'Match' or 'No Match'.

 

Any guidance would be appreciated, thanks!

2 ACCEPTED SOLUTIONS
mh2587
Super User
Super User

  •  
  • Create a Measure to Compare the NAVs: Create a new measure that checks if the NAVs of Fund 1 and Fund 2 are the same.


    DAX
    NAV_Match = IF( [Fund1_NAV] = [Fund2_NAV], 1, 0 )

    Replace [Fund1_NAV] and [Fund2_NAV] with the actual measures or columns representing the NAVs for each fund.

  • Apply Conditional Formatting:

    • Go to your table visual.
    • Click on the Values field where NAV is located.
    • Under Conditional Formatting, choose Background Color or Font Color.
    • Use the custom measure (NAV_Match) as the condition.
    • Set the color rule for 1 as green (when NAVs match) and 0 as red (when they don’t match).

✔ Answered? Mark as solution |
Muhammad HasnainFabric • Power BI • Data Engineering |
LinkedIn

View solution in original post

Anonymous
Not applicable

Thanks for the reply from mh2587  please allow me to provide another insight:

Hi, @ChrisR22 

 

You don’t necessarily need to create so many measures; this depends on your data structure. For instance, in my example, you only need to create one slicer to control the comparisons you wish to make.

vlinyulumsft_0-1729747009425.png

vlinyulumsft_1-1729747009425.png

2.Secondly, I have created measures similar to those mentioned by mh2587 to determine whether they match.

Measure = IF(SUM('Fund 2'[v])=SUM('Fund 1'[v]), "Match", "No Match")

3.Then the two tables are related:

vlinyulumsft_2-1729747058477.png

4.Next, I made modifications to the visual objects in the following locations:

vlinyulumsft_3-1729747058478.png

vlinyulumsft_4-1729747077352.png

5.Finally, I created a slicer:

vlinyulumsft_5-1729747090718.png

6.Below are my final results, which I hope will meet your needs:

vlinyulumsft_6-1729747090720.png

vlinyulumsft_7-1729747111302.png

 

Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

For questions about uploading data, you can try the following links:

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Solved: How to upload PBI in Community - Microsoft Fabric Community

 

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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
mh2587
Super User
Super User

  •  
  • Create a Measure to Compare the NAVs: Create a new measure that checks if the NAVs of Fund 1 and Fund 2 are the same.


    DAX
    NAV_Match = IF( [Fund1_NAV] = [Fund2_NAV], 1, 0 )

    Replace [Fund1_NAV] and [Fund2_NAV] with the actual measures or columns representing the NAVs for each fund.

  • Apply Conditional Formatting:

    • Go to your table visual.
    • Click on the Values field where NAV is located.
    • Under Conditional Formatting, choose Background Color or Font Color.
    • Use the custom measure (NAV_Match) as the condition.
    • Set the color rule for 1 as green (when NAVs match) and 0 as red (when they don’t match).

✔ Answered? Mark as solution |
Muhammad HasnainFabric • Power BI • Data Engineering |
LinkedIn

This is great, thank you. If I were to want to compare many fields (i have roughly 50 i need to run comparison checks on), is the only way to do that to create 50 measures?

No, you don't need 50 measures you just need that field which you are comparing.


✔ Answered? Mark as solution |
Muhammad HasnainFabric • Power BI • Data Engineering |
LinkedIn
Anonymous
Not applicable

Thanks for the reply from mh2587  please allow me to provide another insight:

Hi, @ChrisR22 

 

You don’t necessarily need to create so many measures; this depends on your data structure. For instance, in my example, you only need to create one slicer to control the comparisons you wish to make.

vlinyulumsft_0-1729747009425.png

vlinyulumsft_1-1729747009425.png

2.Secondly, I have created measures similar to those mentioned by mh2587 to determine whether they match.

Measure = IF(SUM('Fund 2'[v])=SUM('Fund 1'[v]), "Match", "No Match")

3.Then the two tables are related:

vlinyulumsft_2-1729747058477.png

4.Next, I made modifications to the visual objects in the following locations:

vlinyulumsft_3-1729747058478.png

vlinyulumsft_4-1729747077352.png

5.Finally, I created a slicer:

vlinyulumsft_5-1729747090718.png

6.Below are my final results, which I hope will meet your needs:

vlinyulumsft_6-1729747090720.png

vlinyulumsft_7-1729747111302.png

 

Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

For questions about uploading data, you can try the following links:

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Solved: How to upload PBI in Community - Microsoft Fabric Community

 

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Users online (24,617)