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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

How to write the measures

Hi all 

 

I have a merge table where I added columns as below.

However there are a lot of columns I need to compare, is it possible to combie the conditional columns or measures to only one by adding "or" condition?

 

= Table.AddColumn(#"Sorted Rows", "Gap1", each if [ReportDate] = [Post.ReportDate] then "No" else "Yes")

Measure 1 = IF(MAX(' Merge '[Gap1])=Yes,"Yellow","White")

= Table.AddColumn(#"Sorted Rows", "Gap2", each if [IssueDate] = [Post.IssueDate] then "No" else "Yes")

Measure 2 = IF(MAX(' Merge '[Gap2])=Yes,"Yellow","White")

= Table.AddColumn(#"Sorted Rows", "Gap3", each if [FixDate] = [Post.FixDate] then "No" else "Yes")

Measure 3 = IF(MAX(' Merge '[Gap3])=Yes,"Yellow","White")

................

 

 

 

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Yes, it is possible to combine the conditional columns or measures into one by using the "OR" operator.

Here's an example of how you can do it:

Combine the three conditional columns into one column using the "OR" operator:

= Table.AddColumn(#"Sorted Rows", "Gap", each if [ReportDate] = [Post.ReportDate] or [IssueDate] = [Post.IssueDate] or [FixDate] = [Post.FixDate] then "No" else "Yes")


Use the combined column in a single measure:

Measure = IF(MAX('Merge'[Gap])=Yes,"Yellow","White")


This will give you a single measure that returns "Yellow" if any of the three conditions are not met, and "White" if all of the conditions are met.


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Yes, it is possible to combine the conditional columns or measures into one by using the "OR" operator.

Here's an example of how you can do it:

Combine the three conditional columns into one column using the "OR" operator:

= Table.AddColumn(#"Sorted Rows", "Gap", each if [ReportDate] = [Post.ReportDate] or [IssueDate] = [Post.IssueDate] or [FixDate] = [Post.FixDate] then "No" else "Yes")


Use the combined column in a single measure:

Measure = IF(MAX('Merge'[Gap])=Yes,"Yellow","White")


This will give you a single measure that returns "Yellow" if any of the three conditions are not met, and "White" if all of the conditions are met.


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

Anonymous
Not applicable

Hi @Anonymous 
You should be able to add a custom column and use the 'or' to combine these. 

forenkl_0-1671784730074.png

Does this work for you?

If it helps, please mark it as resolved and give thumbs up.

 

Thanks!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors