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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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