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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Compare Values of 5 columns with 6th

Hello all,

 

I have been looking through other threads but was unable to find a solution to my probelm. Here is what I am trying to do:

I have the following table:

StatusOverall KPIKPI1KPI2KPI3KPI4KPI5
YellowRedGreenGreenGreenGreenGreen

 

I want to add a column that show me "correct" "incorrect" for

If at least one of KPI1-5 is red, then overall KPI is red,

If at least one of KPI1-5 is yellow, then overall KPI is yellow,

If Overall KPI is Green , then KPI1-5 are green

 

I feel like this should be simple but my brain does not let me find a solution at the moment.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

[Blebleble KPI] =
var __kpis =
    {[KPI1], [KPI2], [KPI3], [KPI4], [KPI5]}
return
    switch( true(),
        "Red" in __kpis,
            "Red",
        "Yellow" in __kpis,
            "Yellow",
        "Green"
    )

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

[Blebleble KPI] =
var __kpis =
    {[KPI1], [KPI2], [KPI3], [KPI4], [KPI5]}
return
    switch( true(),
        "Red" in __kpis,
            "Red",
        "Yellow" in __kpis,
            "Yellow",
        "Green"
    )
Anonymous
Not applicable

Thank you! This works great as now I can compare this new column with the new column

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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