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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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).

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



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).

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



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.


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.