Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

App status based on component status

Hello community,

 

I need to see the application status based on the component status. Each app consists of several components. As soon one of the component status is red, the whole app status is red. Only if all component status is green, the app status is green as well.


My data:

 

App.Comp.Comp. Status
A-1SWgreen
A-1HWgreen
A-2SWgreen
A-2HW1red
A-2HW2red
A-3SWred
A-4HWgreen

 

Do you have any suggestions?

Thank you very much in advance. Your help ist very appreciated.

 

  • Anonymous you can create this measure:

     

     

    App Status = 
    IF(
        HASONEVALUE('Table'[App.]),
        VAR _current_app = SELECTEDVALUE('Table'[App.])
        RETURN
        IF(
            COUNTROWS(
                FILTER(
                    'Table',
                    'Table'[App.] = _current_app && 'Table'[Comp. Status] = "red"
                )
            ) > 0,
            "red",
            "green"
        )
    )

     

     

     

     


    Showcase Report – Contoso By SpartaBI


         

4 Replies

  • SpartaBI's avatar
    SpartaBI
    Icon for Community Champion rankCommunity Champion

    Anonymous you can create this measure:

     

     

    App Status = 
    IF(
        HASONEVALUE('Table'[App.]),
        VAR _current_app = SELECTEDVALUE('Table'[App.])
        RETURN
        IF(
            COUNTROWS(
                FILTER(
                    'Table',
                    'Table'[App.] = _current_app && 'Table'[Comp. Status] = "red"
                )
            ) > 0,
            "red",
            "green"
        )
    )

     

     

     

     


    Showcase Report – Contoso By SpartaBI


         

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Anonymous 
    You can slice by App. then New Measure:
    Status =
    IF ( COUNTROWS ( VALUES ( TableName[Comp. Status] ) ) = 1, "Green", "Red" )

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

     

    try this. I added a cloumn to the table

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    rry I checked badly the firs formula,

     

    Here is the good one

    Status =
    var App='status app'[App.]
    var result2=countrows(filter(summarize('status app','status app'[App.],'status app'[Comp. Status]),'status app'[App.]=App&&'status app'[Comp. Status]="Red"))
    return
    if (result2=0,"Ok","Not Ok")