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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
CaveOfWonders
Helper IV
Helper IV

How to create an Overall RAG Measure from 6 other RAG Measures

Hi All,

 

I have 6 distinct RAG measures formatted as whole numbers. They are coming from different tables and have different logic but the output is the same.

 

The output for all of them will be:

 

0
1
20
300

 

0 represents No Data
1 represents Green,
20 represents Amber
300 represents Red.

 

I need to create a measure which looks at these 6 measures and provides an overall RAG based on the following logic:

 

A red status is generated by two or more reds, or four or more ambers.

 

An amber status is generated by one red, or two or more ambers

 

Otheriwse Green

 

I have tried an failed many times. Could someone please help me figure the DAX out.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@CaveOfWonders , I think the DAX for your OverallRAG measure would be something like this. It assumes your six RAG measures are named [REG1] thru [RAG6]

RAGOverall = 
    VAR vRed = 300
    VAR vAmber = 20
    VAR vGreen = 1
    VAR vRedCount = 
        IF([RAG1] = vRed, 1) 
        + IF([RAG2] = vRed, 1) 
        + IF([RAG3] = vRed, 1)
        + IF([RAG4] = vRed, 1) 
        + IF([RAG5] = vRed, 1) 
        + IF([RAG6] = vRed, 1)

    VAR vAmberCount = IF([RAG1] = vAmber, 1) 
        + IF([RAG2] = vAmber, 1) 
        + IF([RAG3] = vAmber, 1) 
        + IF([RAG4] = vAmber, 1)
        + IF([RAG5] = vAmber, 1) 
        + IF([RAG6] = vAmber, 1)

    RETURN
        SWITCH(TRUE()
            ,vRedCount >= 2, vRed        //RED because 2 or more reds
            ,vAmberCount >= 4, vRed      //RED because 4 or more ambers
            ,vRedCount = 1, vAmber       //AMBER because 1 red
            ,vAmberCount >= 2, vAmber    //AMBER because 2 or more ambers
            ,vGreen                      //GREEN if none of the above apply
        )

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@CaveOfWonders , I think the DAX for your OverallRAG measure would be something like this. It assumes your six RAG measures are named [REG1] thru [RAG6]

RAGOverall = 
    VAR vRed = 300
    VAR vAmber = 20
    VAR vGreen = 1
    VAR vRedCount = 
        IF([RAG1] = vRed, 1) 
        + IF([RAG2] = vRed, 1) 
        + IF([RAG3] = vRed, 1)
        + IF([RAG4] = vRed, 1) 
        + IF([RAG5] = vRed, 1) 
        + IF([RAG6] = vRed, 1)

    VAR vAmberCount = IF([RAG1] = vAmber, 1) 
        + IF([RAG2] = vAmber, 1) 
        + IF([RAG3] = vAmber, 1) 
        + IF([RAG4] = vAmber, 1)
        + IF([RAG5] = vAmber, 1) 
        + IF([RAG6] = vAmber, 1)

    RETURN
        SWITCH(TRUE()
            ,vRedCount >= 2, vRed        //RED because 2 or more reds
            ,vAmberCount >= 4, vRed      //RED because 4 or more ambers
            ,vRedCount = 1, vAmber       //AMBER because 1 red
            ,vAmberCount >= 2, vAmber    //AMBER because 2 or more ambers
            ,vGreen                      //GREEN if none of the above apply
        )

 

 

Amazing. It works, thank you so much.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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