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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

Top Solution Authors