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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
CadenChow
Frequent Visitor

How can I create summary table with strange requirement?

Hi all,

 

I am new joiner of this forum nice to meet you😃

 

I am creating power BI dashboard but I have no clue of how to create the summary table with information below:

 

Full list of RAG status

GroupItemRAG
A1Green
A2Green
A3Green
B1Green
B2Amber
C1Green
C2Amber
C3Red


Summary (if any item in Group = Amber then result is Amber, if any times have red then the result of group is Red). May I know how can I make it? Thanks.

GroupRAG
A

Green

BAmber
CRed

 

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @CadenChow ,

 

According to your needs, I did the following test. First, I created a measure to count the RAG value corresponding to the maximum value in the Item field under the Group grouping. Then create a virtual table, get the correct result, refer to the following: 

v-henryk-mstf_0-1617092857710.png

M = 
VAR _maxitem =
    CALCULATE ( MAX ( 'Table'[Item] ), ALLEXCEPT ( 'Table', 'Table'[Group] ) )
RETURN
    CALCULATE (
        MAX ( 'Table'[RAG] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Group] = SELECTEDVALUE ( 'Table'[Group] )
                && 'Table'[Item] = _maxitem
        )
    )
Result_ = SUMMARIZE('Table','Table'[Group],"RAG",[M])


If the problem is still not resolved, please provide detailed error information. Let me know immediately, looking forward to your reply.

 

Here is the sample pbix file.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
v-henryk-mstf
Community Support
Community Support

Hi @CadenChow ,

 

According to your needs, I did the following test. First, I created a measure to count the RAG value corresponding to the maximum value in the Item field under the Group grouping. Then create a virtual table, get the correct result, refer to the following: 

v-henryk-mstf_0-1617092857710.png

M = 
VAR _maxitem =
    CALCULATE ( MAX ( 'Table'[Item] ), ALLEXCEPT ( 'Table', 'Table'[Group] ) )
RETURN
    CALCULATE (
        MAX ( 'Table'[RAG] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Group] = SELECTEDVALUE ( 'Table'[Group] )
                && 'Table'[Item] = _maxitem
        )
    )
Result_ = SUMMARIZE('Table','Table'[Group],"RAG",[M])


If the problem is still not resolved, please provide detailed error information. Let me know immediately, looking forward to your reply.

 

Here is the sample pbix file.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Syndicate_Admin
Administrator
Administrator

Hey, @CadenChow

Please try the following measure.

RAG by the highest item number
Was
maxitemnumber = MAX('Table'[Item])
Return
CALCULATE( SELECTEDVALUE('Table'[RAG]), 'Table'[Item] = maxitemnumber)

Hi, my name is Jihwan Kim.

If this post helps, consider accepting it as the solution to help other members find it faster.

Jihwan_Kim
Super User
Super User

Hi, @CadenChow 

Please try the below measure.

 

RAG by highest item-number =
VAR
maxitemnumber = MAX('Table'[Item])
RETURN
CALCULATE( SELECTEDVALUE('Table'[RAG]), 'Table'[Item] = maxitemnumber)
 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thanks. May I know why we need to add selectedvalue in the calculate?

Hi, @CadenChow 

Thank you for your feedback.

I used selectedvalue because it had to select the color from the group selection. Then, I could find the maximum number of the item.

 

Thank you.

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Syndicate_Admin
Administrator
Administrator

Hey, @CadenChow

Can you explain yourself a little more?

Because when I see group C, one element has amber and another element has red, but the result is only red.

Perhaps the requirement is to show the result of the highest item number in each group?

Please help to understand more.

Thank you.

Hi, my name is Jihwan Kim.

If this post helps, consider accepting it as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hey, @CadenChow

Can you explain yourself a little more?

Because when I see group C, one element has amber and another element has red, but the result is only red.

Perhaps the requirement is to show the result of the highest item number in each group?

Please help to understand more.

Thank you.

Hi, my name is Jihwan Kim.

If this post helps, consider accepting it as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hey, @CadenChow

Can you explain yourself a little more?

Because when I see group C, one element has amber, and another element has red, but the result is only red.

Perhaps the requirement is to show the result of the highest item number in each group?

Please help to understand more.

Thank you.

Hi, my name is Jihwan Kim.

If this post helps, consider accepting it as the solution to help other members find it faster.

Thanks for your reply. 

 

Perhaps the requirement is to show the result of the highest item number in each group? <- Yes. I want to show highest rating of the group only. I am thinking shall I need to convert the RAG to number then use Max function.

Jihwan_Kim
Super User
Super User

Hi, @CadenChow 

Can you please explain a bit more?

Because when I see group C, one item has Amber, and another item has Red, but the result is only Red.

Perhaps, is the requirement is to show the result that has the highest item number in each group?

Please help to understand more.

Thank you.

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help the other members find it more quickly.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.