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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Serj
Frequent Visitor

Compare text values in matrix

Hi all,

 

I have two datasets:

 

Applications, where each of them can be in one of three statuses: In Production, Ready for Production and Dismissed

Application Name

Application Status

Application1

In production

Application2

Ready for production

Application3

In production

Application4

Dismissed

Application5

Ready for production

 

And Components, where each component can be in one of two statuses: Complete and Incomplete

Component Name

Component Status

Application Link

Component1

Complete

Application1

Component2

Complete

Application2

Component3

Incomplete

Application2

Component4

Incomplete

Application2

Component5

Complete

Application3

Component6

Complete

Application3

Component7

Complete

Application4

Component8

Incomplete

Application4

Component9

Complete

Application5

Component10

Incomplete

Application5

 

Tables have an established relationship

Serj_0-1701711127628.png

 

I have a matrix with a hierarchy and statuses of application and components.

If all Components in the Application have the same status, I show this status, otherwise I put a number of Components:

Measure Component Status = SELECTEDVALUE('Components'[Component Status], DISTINCTCOUNT(Components[Component Name]))

Serj_1-1701711181851.png

 

What I want to have is a new Boolean column (Y/N) at Application level to catch discrepancies between the statuses of Applications and Components following this logic:

  1. If Application = In Production then all its Components must be Completed.
  2. If Application = Ready for Production then all its Components must be Completed or Incomplete.
  3. If Application = Dismissed then all its Components must be Incomplete.

Serj_2-1701711275502.png

 

Would you please advise how to do that?

Thank you!

 

1 REPLY 1
vicky_
Super User
Super User

My attempt is just using a lot of switch cases to match the logic given:

Discrepancy = 
var relatedStatuses = SELECTCOLUMNS(RELATEDTABLE(Components), "status", Components[Component Status])
return SWITCH(TRUE(), 
    Applications[Application Status] = "In Production" && NOT("Incomplete" in relatedStatuses), "No",
    Applications[Application Status] = "Ready for Production", "No", 
    Applications[Application Status] = "Dismissed" && NOT("Complete" in relatedStatuses), "No", 
    "Yes"
)

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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